Click to See Complete Forum and Search --> : [RESOLVED] delete limit issue


ixxalnxxi
02-10-2008, 07:21 AM
i have a delete statement in php as follows

"DELETE exam_qs, exam_choices FROM exam_qs, exam_choice
WHERE exam_qs.id = exam_choices .id_exam_qs AND exam_qs.id = ".$_POST['qID'][0];

the statement works fine, but when i add a LIMIT 8 to the end of it, the sql query does not work and references the LIMIT 8 as the problem. any suggestions? i'd like to have a limit for peace of mind, so i know it won't go insane and delete both the tables.

chazzy
02-10-2008, 08:11 AM
LIMIT is not part of the syntax for DELETE in MYSQL.

http://dev.mysql.com/doc/refman/5.0/en/delete.html

(note: I'm assuming you're using mysql since you referenced limit, which is a mysql-only keyword, not that you mentioned what db and version).