you can do like this.

update link
    set link = if (
                      (select link regexp 'subject') = 1,
                      '<a href="form_url.php"><img src="img.gif" /></
a>',
                      link
                  )

above sql statement will update all row which match 'subject'.


regards,

anru

On Jun 19, 1:37 pm, teedave <[email protected]> wrote:
> It's ok, I managed to do it on a row by row basis using str_replace
> and a while loop.
> Job done.
> Cheers
> Dave T
> P.S. It appears that MySQL does not support regexp in replace sql
> queries. Not that I (or Google) could find anyway.
>
> On Jun 19, 1:15 pm, David Turton
>
>
>
> <[email protected]> wrote:
> > Hi All,
> > I'm familiar with regular expressions, and I'm familiar with replace sql 
> > queries, but I can't get them working together. Google and mysql.com 
> > haven't been much help.
>
> > Or other suggestions for doing this are welcome??
>
> > Need to replace
>
> > <a href="mailto:[email protected]?subject=a Subject String"><img 
> > src="img.gif" /></a>
>
> > With
>
> > <a href="form_url.php"><img src="img.gif" /></a>
>
> > The variable is the "A Subject String", all else is common across all 
> > records. They are all strings, alphanumeric only e.g. [A-Za-z0-9 ] selects 
> > all records.
> > There are 102 records.
>
> > Thanks for any help.
> > Cheers
> > Dave T
>
> > ________________________________
> > Warning: This email contains information which is CONFIDENTIAL and may also 
> > be LEGALLY PRIVILEGED. If you are not the intended recipient you must not 
> > peruse, use, disseminate, distribute or copy this email or attachments. If 
> > you have received this in error, please notify us immediately by return 
> > email and delete this email.
> > Thank you.
>
> > ###########################################################################­##########
> > This e-mail message has been scanned for Viruses and Content and cleared
> > by MailMarshal
> > ###########################################################################­##########
--~--~---------~--~----~------------~-------~--~----~
NZ PHP Users Group: http://groups.google.com/group/nzphpug
To post, send email to [email protected]
To unsubscribe, send email to
[email protected]
-~----------~----~----~----~------~----~------~--~---

Reply via email to