Add onto field when UPDATE mysql

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
Pineriver
Forum Commoner
Posts: 50
Joined: Fri Aug 15, 2003 5:24 pm

Add onto field when UPDATE mysql

Post by Pineriver »

Want to add onto a field at the end of the value in a mysql field.
In PHP if you wanted to add onto a string you would go :

$FieldList ='String';
$FieldList .=' Added Value';
print $FieldList;

Would return 'String Added Value', want to do the same thing when updating a row ..

Code: Select all

mysql_query("UPDATE `users` SET  'FieldList'=+'Added Value' WHERE ....
Something like that
User avatar
hawleyjr
BeerMod
Posts: 2170
Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA

Post by hawleyjr »

This should point you in the right direction:

http://dev.mysql.com/doc/refman/5.0/en/ ... tions.html

Look for concat()
Post Reply