Greenguy's Board


Go Back   Greenguy's Board > Programming & Scripting
Register FAQ Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 2007-11-20, 11:34 AM   #1
CelticTiger
Are you sure this is the Sci-Fi Convention? It's full of nerds!
 
CelticTiger's Avatar
 
Join Date: Feb 2004
Location: Ireland
Posts: 266
Send a message via ICQ to CelticTiger
SQL Statement help

I've been trying to delete some links from my database using the following statement:

DELETE FROM `links` WHERE (SELECT * FROM `links` WHERE `url` LIKE '%domain%')

but get the following error:

"Operand should contain 1 column(s)"

Can anyone tell me where I'm going wrong?

Thanks!
__________________

Submissions Wanted!
CelticTiger is offline   Reply With Quote
Old 2007-11-20, 03:06 PM   #2
HowlingWulf
Me fail English? That's unpossible!
 
HowlingWulf's Avatar
 
Join Date: Dec 2003
Location: FL
Posts: 1,381
Send a message via ICQ to HowlingWulf
Why do you have SELECT in there?
Should be more like

DELETE FROM `links` WHERE `url` LIKE '%domain%';
__________________
WordPress Porn directory theme => Maddos
Create a Porn Tube => Video Pornster
HowlingWulf is offline   Reply With Quote
Old 2007-11-20, 03:42 PM   #3
CelticTiger
Are you sure this is the Sci-Fi Convention? It's full of nerds!
 
CelticTiger's Avatar
 
Join Date: Feb 2004
Location: Ireland
Posts: 266
Send a message via ICQ to CelticTiger
Yeah - tried that and was getting an error with that one too....so figured I needed a subquery.
__________________

Submissions Wanted!
CelticTiger is offline   Reply With Quote
Old 2007-11-20, 07:58 PM   #4
Useless
Certified Nice Person
 
Useless's Avatar
 
Join Date: Oct 2003
Location: Dirty Undies, NY
Posts: 11,268
Send a message via ICQ to Useless
Wouldn't the simplist solution be
delete from 'links' where 'url' = 'whatever'
__________________
Click here to purchase a bridge I'm selling.
Useless is offline   Reply With Quote
Old 2007-11-20, 08:30 PM   #5
CelticTiger
Are you sure this is the Sci-Fi Convention? It's full of nerds!
 
CelticTiger's Avatar
 
Join Date: Feb 2004
Location: Ireland
Posts: 266
Send a message via ICQ to CelticTiger
It would if it was just one url unfortunately there are about 1500 from one domain that I need to delete - plus many more domains will pop up I'm sure that will need the same treatment.
__________________

Submissions Wanted!
CelticTiger is offline   Reply With Quote
Old 2007-11-21, 06:59 AM   #6
shunga
Operator! Give me the number for 911!
 
Join Date: Dec 2005
Location: Loveland
Posts: 131
Send a message via ICQ to shunga
I would use this:

DELETE FROM links WHERE url LIKE '%domain%'
__________________

Got an Asian site?
ICQ: 355-26-288
shunga is offline   Reply With Quote
Old 2007-11-21, 10:49 AM   #7
CelticTiger
Are you sure this is the Sci-Fi Convention? It's full of nerds!
 
CelticTiger's Avatar
 
Join Date: Feb 2004
Location: Ireland
Posts: 266
Send a message via ICQ to CelticTiger
I tried that before posting - no luck with it - which is why I tried using the subquery.

Does Sparky still frequent the board?
__________________

Submissions Wanted!
CelticTiger is offline   Reply With Quote
Old 2007-11-21, 10:56 AM   #8
CelticTiger
Are you sure this is the Sci-Fi Convention? It's full of nerds!
 
CelticTiger's Avatar
 
Join Date: Feb 2004
Location: Ireland
Posts: 266
Send a message via ICQ to CelticTiger
I got it
__________________

Submissions Wanted!
CelticTiger is offline   Reply With Quote
Old 2007-11-21, 11:22 AM   #9
shunga
Operator! Give me the number for 911!
 
Join Date: Dec 2005
Location: Loveland
Posts: 131
Send a message via ICQ to shunga
Quote:
Originally Posted by CelticTiger View Post
I tried that before posting - no luck with it - which is why I tried using the subquery.
MySQL can be quite pedantic with quotation marks.

Glad you could find the solution.
__________________

Got an Asian site?
ICQ: 355-26-288
shunga is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 05:25 PM.


Mark Read
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
© Greenguy Marketing Inc