Current location: Hot Scripts Forums » Programming Languages » PHP » what is wrong with this mysql query?


what is wrong with this mysql query?

Reply
  #1 (permalink)  
Old 05-05-05, 09:16 PM
halcali halcali is offline
Newbie Coder
 
Join Date: May 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
what is wrong with this mysql query?

the following does not work for me, and i can't figure out why. any ideas?

delete quiz,result,category,question,user_comments from quiz as q, result as
r, category as c, question as qs, user_comments as u where q.time<1110256723
and q.no_hits=0 and q.quiz_id=r.quiz_id and q.quiz_id=c.quiz_id and
q.quiz_id=qs.quiz_id and q.quiz_id=u.quiz_id
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 05-06-05, 12:02 AM
halcali halcali is offline
Newbie Coder
 
Join Date: May 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
what i wanted the above query to accomplish is...

i have five tables quiz, result, category, question, user_comments

all have an identical field called 'quiz_id'

so i want to find all records in quiz where the 'time' field <1110256723 and the 'no_hits' field is = 0, and then delete all those records and any records in result, category, question, and user_comments tables that have the same 'quiz_id' value


anyone know what query would work for that?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
MYSQL Distinct Query problem FunkyM PHP 20 02-28-07 09:33 AM
MySQL SELECT query result dividing ICE Flame PHP 1 06-06-04 03:50 PM
PHP:search by MySQL query lowdog PHP 0 02-15-04 11:04 AM
Declared Functions skipper23 PHP 4 12-17-03 11:06 AM
index page not showing up skipper23 PHP 3 12-15-03 02:10 PM


All times are GMT -5. The time now is 10:21 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.