Gossamer Forum
Home : Products : Gossamer Links : Discussions :

SQL Questions

Quote Reply
SQL Questions
Hello



A specific domain has over 300 links in our database have just moved to a new domain name.

They are going to keep the same site structure, only the domain name is changed..

Is there an easy way to update all the links from that domain in the database to reflect the new domain through SQL queries?
Regards
KaTaBd

Users plug In - Multi Search And Remote Search plug in - WebRing plug in - Muslims Directory
Quote Reply
Re: [katabd] SQL Questions In reply to
UPDATE Links SET URL = REPLACE(URL, 'http://www.oldurl.com', 'http://www.newurl.com');
Quote Reply
Re: [RedRum] SQL Questions In reply to
Thanks



Will that work even on www.oldurl/whatever.html and www.oldurl/something/whatever as well
Regards
KaTaBd

Users plug In - Multi Search And Remote Search plug in - WebRing plug in - Muslims Directory
Quote Reply
Re: [katabd] SQL Questions In reply to
Yup - will only replace what you enter, not the whole value.

Unlike...

UPDATE Links SET URL = 'http://www.newurl.com'


Last edited by:

RedRum: Jan 1, 2002, 5:09 AM
Quote Reply
Re: [RedRum] SQL Questions In reply to
Sounds good..

Thanks

Quote Reply
Re: [RedRum] SQL Questions In reply to
I am getting an error message:



Error: Query Error: Failed to execute query: 'UPDATE Links SET URL = REPLACE(URL, 'http://www.idleb.com', 'http://www.2muslims.com'); ' Reason: You have an error in your SQL syntax near '; ' at line 1



any suggestions?
Regards
KaTaBd

Users plug In - Multi Search And Remote Search plug in - WebRing plug in - Muslims Directory
Quote Reply
Re: [katabd] SQL Questions In reply to
Get rid of the trailing ';'

I've found that for single queries, that seems to cause problems, even though it shouldn't.




PUGDOG´┐Ż Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [pugdog] SQL Questions In reply to
Thanks



Strange but works..
Regards
KaTaBd

Users plug In - Multi Search And Remote Search plug in - WebRing plug in - Muslims Directory
Quote Reply
Re: [RedRum] SQL Questions In reply to
Hi

Can I use the same command logic to change a specific word in the description or keywords?

Or do i have to change it?
Regards
KaTaBd

Users plug In - Multi Search And Remote Search plug in - WebRing plug in - Muslims Directory
Quote Reply
Re: [katabd] SQL Questions In reply to
Yes the same will work for those fields.