The mysql_num_rows() function returns the number of rows returned in your record set, which when limited is 10 (not 100). Thus you will have to do another query.
--Joe -- Joe Stump Affordable Computers, Inc. 800-864-2345 x113 ----- Original Message ----- From: "SED" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Tuesday, November 05, 2002 4:54 PM Subject: PHP + MySQL, how to get total rows matched when using LIMIT 0, 10? > I'm trying to get the total matched rows when I'm using "LIMIT 0, 10", > but I only get the number 10, when the total should be around 100. So, > can I get total matched rows without doing a separate query using > count()? > > Here is an example of my current query: > > $result = mysql_query("SELECT * FROM products WHERE price<'10' ORDER BY > price LIMIT 0, 10"); > $num_rows = mysql_num_rows($result); > --------------------------------------------------------------------- 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