niche Posted July 16, 2011 Share Posted July 16, 2011 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()); Link to comment Share on other sites More sharing options...
Synook Posted July 17, 2011 Share Posted July 17, 2011 UPDATE stk SET some_field = CONCAT(some_field, "more_data") ... Link to comment Share on other sites More sharing options...
niche Posted July 17, 2011 Author Share Posted July 17, 2011 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 More sharing options...
niche Posted July 17, 2011 Author Share Posted July 17, 2011 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. Link to comment Share on other sites More sharing options...
Synook Posted July 17, 2011 Share Posted July 17, 2011 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 More sharing options...
niche Posted July 17, 2011 Author Share Posted July 17, 2011 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.