Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-12-2009, 09:44 AM   PM User | #1
jeddi
Senior Coder

 
Join Date: May 2006
Posts: 1,513
Thanks: 26
Thanked 4 Times in 4 Posts
jeddi has a little shameless behaviour in the past
Appending to an existing table record?

Hello,

I am writing a simple "mini-blog" for my website. I don't want all the works of a wordpress or other program so I am just using a text area to update one of the fields in my table.

Is there a way to simply add extra data on the end of a mysql table record without reading the exiesting data into a variable, appending the new info and then UPDATE'ing the record ?

Thanks for any info
jeddi is offline   Reply With Quote
Old 01-12-2009, 11:09 AM   PM User | #2
abduraooft
Supreme Master coder!

 
abduraooft's Avatar
 
Join Date: Mar 2007
Location: N/A
Posts: 14,678
Thanks: 158
Thanked 2,182 Times in 2,169 Posts
abduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really nice
Code:
update table_name set filed_name=concat(filed_name,'new string') where...
__________________
Quote:
The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)
abduraooft is offline   Reply With Quote
Old 01-12-2009, 02:36 PM   PM User | #3
jeddi
Senior Coder

 
Join Date: May 2006
Posts: 1,513
Thanks: 26
Thanked 4 Times in 4 Posts
jeddi has a little shameless behaviour in the past
Yes - thats it !

I have been reading about concat() but couldn't see how to use it !

So UPDATE tbl SET fld = CONCAT(fld, 'new text'); should do the business
Thanks
jeddi is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:39 PM.


Advertisement
Log in to turn off these ads.