Re: Simple field replace...?
| From: | Ignatius Reilly | Date: | Thu, 28 Aug 2003 10:29:17 +0000 |
| Subject: | Re: Simple field replace...? | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-30171@lists.php.net to get a copy of this message | ||
Then a simple substring will do:
UPDATE mytable
SET url = SUBSTRING( url FROM 5 )
btw your date column looks pretty awful.
HTH
Ignatius
_________________________
----- Original Message -----
From: <Tristan.Pretty@risk.sungard.com>
To: "Ignatius Reilly" <ignatius.reilly@free.fr>
Cc: <php-db@lists.php.net>
Sent: Thursday, August 28, 2003 12:06 PM
Subject: Re: [PHP-DB] Simple field replace...?
> Sorry, I'll specify...
> I have one column, in a row of perhaps 4 fields.
> I want to remove the first 32 characters from onlt one field
>
> EG:
> My DB:
>
> name date url ip
> bob 1/2/99 http:// 1.1.1.1.
> sue 4/6/01 http:// 2.2.2.2
>
> If I wanted to remove just the http bit and leave ://
> I'd have to remove the first 4 characters from all the 'url' column.
> this is what I wanna do, jsut 100+ times over. but the first 32
> characters.
>
>
>
>
>
> "Ignatius Reilly" <ignatius.reilly@free.fr>
> 28/08/2003 11:04
>
>
> To: <php-db@lists.php.net>, <Tristan.Pretty@risk.sungard.com>
> cc:
> Subject: Re: [PHP-DB] Simple field replace...?
>
>
> hundreds of what? rows or columns?
>
> Ignatius
> _________________________
> ----- Original Message -----
> From: <Tristan.Pretty@risk.sungard.com>
> To: <php-db@lists.php.net>
> Sent: Thursday, August 28, 2003 11:35 AM
> Subject: [PHP-DB] Simple field replace...?
>
>
> > Hi there,
> > I need to take a field in my database, and remove the first 32
> characters
> > from each entry...
> > There are 100's, and I know there's gotta be an easy way...
> > I've looked up string replace, and it only appears to work one at a
> > time...
> > Can anyone tell me how to make it accross the whole table...?
> >
> > *********************************************************************
> > The information contained in this e-mail message is intended only for
> > the personal and confidential use of the recipient(s) named above.
> > If the reader of this message is not the intended recipient or an agent
> > responsible for delivering it to the intended recipient, you are hereby
> > notified that you have received this document in error and that any
> > review, dissemination, distribution, or copying of this message is
> > strictly prohibited. If you have received this communication in error,
> > please notify us immediately by e-mail, and delete the original message.
> > ***********************************************************************
> >
> >
>
>
>
>
>
> *********************************************************************
> The information contained in this e-mail message is intended only for
> the personal and confidential use of the recipient(s) named above.
> If the reader of this message is not the intended recipient or an agent
> responsible for delivering it to the intended recipient, you are hereby
> notified that you have received this document in error and that any
> review, dissemination, distribution, or copying of this message is
> strictly prohibited. If you have received this communication in error,
> please notify us immediately by e-mail, and delete the original message.
> ***********************************************************************
>
>