Apromer
Apromer

Reputation: 57

PHP MySQL update set

I'm trying to update a row, but only to append a new word at words:

mysql_query("UPDATE list SET words = words', $new_word' WHERE id = $id_row");

It's not working, I've no other ideas..

Upvotes: 0

Views: 30

Answers (1)

Sougata Bose
Sougata Bose

Reputation: 31749

Try with CONCAT-

"UPDATE list SET words = CONCAT(words, '$new_word') WHERE id = $id_row"

Use mysqli or PDO. mysql is deprecated.

Upvotes: 1

Related Questions