Re: Change value in the table
| From: | Andrey Hristov | Date: | Sun, 23 Dec 2001 15:09:23 +0000 |
| Subject: | Re: Change value in the table | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-15200@lists.php.net to get a copy of this message | ||
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" <nagasea@kaskus.com>
To: <php-db@lists.php.net>
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: php-db-unsubscribe@lists.php.net
> For additional commands, e-mail: php-db-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>