Actually that does retrieve the number of rows.. // Query $query = "SELECT COUNT(*) AS count FROM pet";
// Execute Query $result = mysql_query($query); // Get the result of query named count $count = mysql_result($result,0); echo $count." is the number of rows"; Cheers! Rick In order to seek truth it is necessary once in the course of our life to doubt as far as possible all things. - Rene Descartes > From: Yury B. <[EMAIL PROTECTED]> > Reply-To: [EMAIL PROTECTED] > Date: Thu, 31 Jul 2003 19:46:40 +0200 > To: [EMAIL PROTECTED] > Subject: [PHP] COUNT(*) > > Hi > > I used to use old fashioned mysql quieries but moderm mysql > apparently became more flexible so. I want to understand how to use > some of the new features like COUNT(*) > > Let's say I have > $result="SELECT COUNT(*) FROM pet"; > $sql=mysql_query($result); > while ($row=mysql_fetch_array($sql)){ > $pet_name=$row['pet_name']; > echo ......; > } > > the question is how do I actually retrieve the number of rows of sql > query result? > > Yury > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php