Need help with SQL Query

HelpNearMe
HelpNearMe used Ask the Experts™
on
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
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
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.
Commented:
That looks like a Joomla! table (_jos) and should be changed in the Joomla Admin.
If it's a Module:
Extensions > Module Manager > Site >Whatever Module you're changing
On the right hand side you will see Module Parameters.
Change the Target to Parent Window with Browser Navigation.
Save.
Refresh your webpage & give it a go.
I'm gonna be gone a few days so no follow up but you might want to post this in the Joomla area if you get stuck.  kevin

Author

Commented:
kpmartin: Really?  that will update the DB too?  Or just new articles?  Thanks!
Become a Certified Penetration Testing Engineer

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

Commented:
Yes it will update the db.  Menu links have that setting in the lower left side.
kevin

Author

Commented:
wow thats excellent I'll give it a try

thanks
Database Consultant
Commented:
UPDATE jos_content REPLACE(FIELDNAME,'<a target="_blank" href="index','<a target="_self" href="index') WHERE <CONDITION-IF-ANY>;

Author

Commented:
Thanks the query from theGhost_k8 worked great

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial