Link to home
Create AccountLog in
Avatar of HelpNearMe
HelpNearMeFlag for Afghanistan

asked on

Need help with SQL Query

Hi Experts,

In the jos_content table column introtext, I would like to replace any occurance of this:

<a target="_blank" href="index

with:
<a target="_self" href="index

Can someone show me how this query would be formed? (MySQL 5.0.32) & myPHPAdmin

thanks!

HNM
Avatar of akitsupport
akitsupport
Flag of United Kingdom of Great Britain and Northern Ireland image

update jobs_content
SET  = jobs_content.Fieldname = <a target="_self" href="index
where jobs_content.Fieldname = <a target="_blank" href="index

Should work though I don't know the fieldname you are trying to change hence my comment of Fieldname

I would try it on a single record first just to be sure or make a copy of the table and try it out as I don't know how your system looks and such.
SOLUTION
Avatar of kpmartin
kpmartin
Flag of United States of America image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of HelpNearMe

ASKER

kpmartin: Really?  that will update the DB too?  Or just new articles?  Thanks!
Yes it will update the db.  Menu links have that setting in the lower left side.
kevin
wow thats excellent I'll give it a try

thanks
ASKER CERTIFIED SOLUTION
Avatar of theGhost_k8
theGhost_k8
Flag of India image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Thanks the query from theGhost_k8 worked great