Have you tried using the $rows = $sth->rows() after you execute to get the total rows returned?
>>On Wed, 31 Oct 2001 00:43:00 +0000, Mark Worsdall <[EMAIL PROTECTED]> wrote: >>Hi, >> >>I want to alter this statement so it returns the number of records. >> >>$prep = "SELECT COUNT(*) FROM go.objectives WHERE subjects_id='1' AND >>subjectHeadings_id='2' ORDER BY displayOrder"; >> >>$sth = $dbh->prepare($prep); >> >>$sth->execute; >> >>So what I need to do is add the COUNT statement into the above and then >>return the number of records but how? >> >>MySQL table query Mike(mickalo)Blezien =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Thunder Rain Internet Publishing Providing Internet Solutions that work! http://www.thunder-rain.com Tel: 1(225)686-2002 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= --------------------------------------------------------------------- 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