[prev in list] [next in list] [prev in thread] [next in thread]
List: php-db
Subject: Re: [PHP-DB] UPDATE query
From: Omega -1911 <1911que () gmail ! com>
Date: 2011-03-19 23:10:48
Message-ID: AANLkTim2ZHBZkx_617k2xLQQkU3K-M9xswN6NQtP1zzg () mail ! gmail ! com
[Download RAW message or body]
On Tue, Mar 8, 2011 at 11:16 AM, Ron Piggott
<ron.piggott@actsministries.org> wrote:
>
> I am wondering if there is a way to do an UPDATE query where only some of the text changes.
>
> The column I need to modify is named “toll_free”
> What I need to search for is: 800-
> I need it to replace it with is 1-800-
> - BUT I don’t want to change instances of 1-800-
> - I need to leave the rest of the toll free phone number in tact.
>
Another example::
-------------------------------------
update TABLE_NAME set FIELD_NAME = replace(FIELD_NAME, ‘find this
string’, ‘replace found string with this string’);
update client_table set company_name = replace(company_name, ‘Old
Company’, ‘New Company’)
The above statement will replace all instances of ‘Old Company’ to
‘New Company’ in the field of company_name of client_table table.
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic