Go Back   CodingForums.com > :: Server side development > MySQL

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Old 01-13-2005, 09:22 PM   PM User | #1
alaios
Regular Coder

 
Join Date: Aug 2002
Posts: 421
Thanks: 0
Thanked 0 Times in 0 Posts
alaios is an unknown quantity at this point
delete and and

Could u plz explain me why the delete with the the and doesn't work??
delete from sessions where session="f90272aa4c90197776c2d269c4e7f8d0" and isbn=" 0-0230942-1-4"

this command
delete from sessions where session="f90272aa4c90197776c2d269c4e7f8d0"
works fine
delete from sessions where isbn=" 0-0230942-1-4"
and also this one too
alaios is offline   Reply With Quote
Old 01-13-2005, 10:28 PM   PM User | #2
Scrowler
Regular Coder

 
Join Date: Jul 2003
Location: New Zealand
Posts: 433
Thanks: 1
Thanked 0 Times in 0 Posts
Scrowler is an unknown quantity at this point
from what i can see, there is no reason they shouldn't work together. but if you can't get it sorted, just do two queries. i also expect that you only want to delete one session? include limit attribute.

Code:
delete from sessions where session="f90272aa4c90197776c2d269c4e7f8d0" limit 1
delete from sessions where isbn=" 0-0230942-1-4"
personally, i would write the query's attribute names in uppercase, but that probably doesn't affect the script's operation, except your tablename, which is case sensitive, i.e. 'sessions' will work but 'SESSIONS' wont.

Code:
DELETE FROM sessions WHERE session = "f90272aa4c90197776c2d269c4e7f8d0" LIMIT 1
DELETE FROM sessions WHERE isbn = " 0-0230942-1-4"
Scrowler is offline   Reply With Quote
Old 01-13-2005, 10:38 PM   PM User | #3
raf
Master Coder


 
Join Date: Jul 2002
Posts: 6,589
Thanks: 0
Thanked 0 Times in 0 Posts
raf is on a distinguished road
doing it withtwo querys is impossible. That would be the equivalent of
where session="f90272aa4c90197776c2d269c4e7f8d0" OR isbn=" 0-0230942-1-4"

Quote:
Could u plz explain me why the delete with the the and doesn't work??
What do you mean? Do you get an error or are no rows deleted?

If no rows or deleted, then this usually means that none of the records passed both conditions ... was the space in the isbn-value intentionally?
try a
SELECT COUNT(*) as checknum FROM sessions WHERE session="f90272aa4c90197776c2d269c4e7f8d0" and isbn=" 0-0230942-1-4"

and check if checksum is higer then 0
__________________
Posting guidelines I use to see if I will spend time to answer your question : http://www.catb.org/~esr/faqs/smart-questions.html
raf is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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 +1. The time now is 03:38 AM.

Home - Contact Us - Archives - Link to CF - Resources - Top 

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.