[Typo3] class.t3lib_db.php and CONCAT

JoH info at cybercraft.de
Tue Apr 5 15:03:52 CEST 2005


>> UPDATE table SET field=CONCAT(field,',username:value');
>
> I had the problem that I needed to do:
>
> UPDATE table SET field=field+1;
>
> which is similar to your problem (you want to increase some value).
>
>
> The guys on the dev list told me to just use
>
> $GLOBALS['TYPO3_DB']->sql()
>
> function. They meant than everything get's handled by DBAL. If you
> look into the sourcecode of t3lib_db you will see that this is of
> course not true ... but AFAIK DBAL will be something which replaces
> t3lib_db via XCLASS ....
>
> so pherhaps the ->sql() function parameters get parsed into commands
> which can be understood by every DB .... but I don't know exactly
> about this and you will need to ask Karsten ...

Don't know when they told you but now the description of this function reads
like this:
Executes query
mysql() wrapper function
DEPRECIATED - use exec_* functions from this class instead!

But there is no exec_* function available that could handle CONCAT the way I
described it.
But I had another idea: What about replacing $val with CONCAT($key,',$val')
in the array that contains the fields and values to be updated?

Joey

-- 
Wenn man keine Ahnung hat: Einfach mal Fresse halten!
(If you have now clues: simply shut your gob sometimes!)
Dieter Nuhr, German comedian
openBC: http://www.openbc.com/go/invuid/Jo_Hasenau





More information about the TYPO3-english mailing list