note 18794 added to function.mysql-fetch-row

From: Date: Wed, 06 Feb 2002 01:07:03 +0000
Subject: note 18794 added to function.mysql-fetch-row
Groups: php.notes 
Request: Send a blank email to php-notes+get-26276@lists.php.net to get a copy of this message
This took me a few minutes to suss out, so I thought I'd share it: If your doing a select count(*) statement, the simplest syntax I have come up with to actually get access to the value is: // stores the result in an array: $count = mysql_fetch_array(mysql_query($query_string, $db)); // the actual count is stored in the first index (0): print("row count: $count[0]"); NB I've ignored error checking here :) Christo Fogelberg -- http://www.php.net/manual/en/function.mysql-fetch-row.php http://master.php.net/manage/user-notes.php?action=edit+18794 http://master.php.net/manage/user-notes.php?action=delete+18794 http://master.php.net/manage/user-notes.php?action=reject+18794

« previous php.notes (#26276) next »