mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
mysql_num_rows example
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@35032 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
4e640f8c44
commit
e1737da3ca
1 changed files with 16 additions and 0 deletions
|
@ -1524,6 +1524,22 @@ field3
|
|||
a result set. This command is only valid for SELECT statements.
|
||||
To retrieve the number of rows returned from a INSERT, UPDATE or
|
||||
DELETE, use <function>mysql_affected_rows</function>.
|
||||
<example>
|
||||
<title>
|
||||
<function>
|
||||
mysql_num_rows example by crubel@trilizio.org
|
||||
</function>
|
||||
</title>
|
||||
<programlisting role="php">
|
||||
<?php
|
||||
$conn = mysql_connect("hostaddress", "username", "password");
|
||||
mysql_select_db("database",$conn); // needed if you have m,ultiple db's
|
||||
$Resultfornummembers = mysql_query("SELECT * FROM Accounts",$conn);
|
||||
$NumMembers = mysql_numrows($Resultfornummembers);
|
||||
echo "$NumMembers Members";
|
||||
?>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
<para>
|
||||
See also:
|
||||
|
|
Loading…
Reference in a new issue