Welcome to WebmasterWorld Guest from 54.196.214.35

Forum Moderators: open

Message Too Old, No Replies

Appending Data

Apending Data using SQL query

     
10:47 am on Oct 13, 2005 (gmt 0)

New User

10+ Year Member

joined:Oct 13, 2005
posts:5
votes: 0


I wonder if there is any way to APPEND data to an already populated field using a SQL query. I'm presently handeling it through PHP by writing two queries.
12:38 pm on Oct 13, 2005 (gmt 0)

Senior Member from MT 

WebmasterWorld Senior Member 10+ Year Member

joined:Apr 1, 2003
posts:1843
votes: 0


I suppose it would go like this:

UPDATE table SET field1=CONCAT(field1,' this will be appended to the end of field1') WHERE id=12345;

SN

7:49 am on Oct 16, 2005 (gmt 0)

New User

10+ Year Member

joined:Oct 13, 2005
posts:5
votes: 0


Thanks killroy
12:43 am on Oct 17, 2005 (gmt 0)

Administrator

WebmasterWorld Administrator coopster is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:July 31, 2003
posts:12533
votes: 0


That killroy supposes correctly quite often ;)

Welcome to WebmasterWorld, binarytrends.

12:54 am on Oct 17, 2005 (gmt 0)

Senior Member

WebmasterWorld Senior Member txbakers is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Sept 1, 2001
posts:4392
votes: 0


I always forget the CONCAT and try to do it with a simple ampersand and wonder why all my data disappears!
5:53 am on Oct 18, 2005 (gmt 0)

New User

10+ Year Member

joined:Oct 13, 2005
posts:5
votes: 0


Hi Coopster, You must be right :)