Try this:
UPDATE your_table SET your_field=
CONCAT(
  SUBSTR(str,0,INSTR(str,text_to_be_replaced)),
  your_replacement,
  SUBSTR(str, INSTR(str,text_to_be_replaced)+LEGNTH(text_to_be_replaced) )
)
WHERE your_field like '%text_to_be_replaced%';

May be there is a need for some changes

HTH

Regards,
Andrey Hristov

----- Original Message ----- 
From: "Nagasea" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, December 23, 2001 4:56 PM
Subject: [PHP-DB] Change value in the table


> I want to change all the text XXX to YYY in the posts_text table. 
> I know i can do that in the phpMyAdmin by running a queries. 
> Can someone let me know what should i write ?
> 
> note : I want to change a single word (XXX) within the whole post test. 
> 
> 
> ------------------------- 
> ID | POST | 
> ------------------------- 
> 1 | Happy XXX | 
> 2 | Super XXX | 
> 3 | Mouse XXX | 
> ------------------------- 
> 
> 
> 
> _____________________________________________________________
> www.kaskus.com - Community Forum & Free Email service
> 
> -- 
> 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]
> 
> 


-- 
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]

Reply via email to