Page 1 of 1

Add something to a mysql string field

Posted: Tue May 17, 2005 5:18 pm
by Todd_Z
Lets say a field has the value White, but I want to add " dog" to it, how do I do that in a query?

Posted: Tue May 17, 2005 5:34 pm
by Burrito

Code: Select all

var = &quote;dog&quote;;
mysql_query(&quote;update myTable set myField = concat(myField, '&quote;.$var.&quote;') where id = $myid&quote;)
  or die(mysql_error());