Jump to content

Concatenate data to existing data in a column


niche
 Share

Recommended Posts

What's the notation to concatenate data to existing data in a field?mysql_query("UPDATE stk SET some_field = '????????????' WHERE id = " . $upc_key . "") or die(mysql_error());

Edited by niche
Link to comment
Share on other sites

no joy:mysql_query("UPDATE disclaimers SET disclaimer = CONCAT(disclaimer,"ABCD") WHERE id = '1'") or die(mysql_error());or:mysql_query("UPDATE disclaimers SET disclaimer = CONCAT(disclaimer,"ABCD") ") or die(mysql_error());Both produce a parse error.

Link to comment
Share on other sites

Ahhhhh!mysql_query("UPDATE disclaimers SET disclaimer = CONCAT(disclaimer,'ABCD') WHERE id = '1'") or die(mysql_error());succeeded!Thanks Synook!EDIT: Time to watch CHAOS.

Edited by niche
Link to comment
Share on other sites

By the way, the reason why your previous statements weren't working was because you didn't escape your quotes.

Link to comment
Share on other sites

Again, thanks for your help. There's obviously a difference between getting "it" to work and knowing why "it" works. I haven't actually needed to escape quotes before except in tutorials. Thanks, Niche.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...