Re: [PHP-DB] UPDATE query to add to a field

2002-01-28 Thread Paul DuBois

At 9:06 -0800 1/28/02, Adv. Systems Design wrote:
hello all:

I need to be able to update a field in MySQL, the catch is that I 
have to add on to text that is already there and I have to be able 
to do it within MySQL (phpMyAdmin). My first idea was to do:

SET prod_desc = prod_desc + more info to tack on to end

but this is a mathematical function which returns 0!

Use CONCAT().

Any ideas?

Thanks


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] UPDATE query to add to a field

2002-01-28 Thread Joffrey van Wageningen

 SET prod_desc = prod_desc + more info to tack on to end
 
 but this is a mathematical function which returns 0!

update table set field = concat(field, more info) where id = 1;

find the string functions in the mysql manual...

with kind regards,
Joffrey van Wageningen


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] UPDATE query to add to a field

2002-01-28 Thread DL Neil

Hello Adv. Systems Design,

 I need to be able to update a field in MySQL, the catch is that I have to add on to 
text that is already there
and I have to be able to do it within MySQL (phpMyAdmin). My first idea was to do:

 SET prod_desc = prod_desc + more info to tack on to end

 but this is a mathematical function which returns 0!

 Any ideas?


SET prod_desc = CONCAT( prod_desc, more info to tack on to end )

Manual: 6.3.2  String Functions

Regards,
=dn



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]