In message <[EMAIL PROTECTED]>, Steve Meyers <[EMAIL PROTECTED]> writes >> But when I add in the LIMIT statement it returns no records >> >> $prep = "SELECT id,name FROM go.objectives WHERE subjects_id='1' AND >> subjectHeadings_id='2' LIMIT 1,5 ORDER BY displayOrder"; >> >> $sth = $dbh->prepare($prep); >> >> $sth->execute; >> >> > >http://www.mysql.com/doc/S/E/SELECT.html > >The LIMIT goes after the ORDER BY. On a related note, maybe you should >check for MySQL error codes when you run a query :) >
You are quite correct and it is a major weakness of mine, I generally manually run a query until I know it will work fine then put it in perl knowing it works fine. On this occassion I decided to implement the error checking by raising errors through the mailing list, this seemed to work very well:-) Seriously I will get the script to raise the errors and stop the clogging up of the mail list. But thankyou to you all. -- Work:- postmasterAThinwick.demon.co.uk WEB:- http://www.hinwick.demon.co.uk Work:- mworsdallATshaftesburysoc.org.uk REPLACE AT with @ Home:- hinwickATworsdall.demon.co.uk WEB:- http://www.worsdall.demon.co.uk Shadow:- webmasterATshadow.org.uk WEB:- http://www.shadow.org.uk --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php