note 53416 added to function.mysql-num-rows
| From: | wil1488 at gmail dot com | Date: | Wed, 01 Jun 2005 02:53:10 +0000 |
| Subject: | note 53416 added to function.mysql-num-rows | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-89714@lists.php.net to get a copy of this message | ||
To use SQL COUNT function, without select the source...
see an example:
<?
//MAKE THE CONNECTION WITH DATABASE
$my_table = mysql_query("SELECT COUNT(*) as TOTALFOUND from table", $link); //EXECUTE SQL
CODE
Note: will return the total on TOTALFOUND
print (mysql_result($my_table,0,"TOTALFOUND")); //use the field camp to get the total from
your SQL query!
?>
Thanks, good luck.
----
Manual Page -- http://www.php.net/manual/en/function.mysql-num-rows.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+53416
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+53416&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+53416&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+53416&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+53416&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+53416&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+53416&report=yes
Search -- http://master.php.net/manage/user-notes.php