I have table named Posts
I want to add some words to the end of this all posts in the table.
If I wanted to replace a word in my all posts I would use this query:
UPDATE posts
SET post_content = Replace(post_content, 'old_word', 'new_word')
but I want to add words to the end of my posts, not replace
Note: I want to do this in SQL query, without PHP
It's similar to your example with REPLACE() but you would use CONCAT(). http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_concat
UPDATE posts SET post_content=CONCAT(post_content, ' Text you want to append.');
Sounds like you want to use MySql "concat()":
http://dev.mysql.com/doc/refman/5.0/en/string-functions.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With