mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-19 18:38:55 +00:00

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@183245 c90b9560-bf6c-de11-be94-00142212c4b1
113 lines
2.7 KiB
XML
113 lines
2.7 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision: 1.8 $ -->
|
|
<refentry id="function.mysql-num-rows">
|
|
<refnamediv>
|
|
<refname>mysql_num_rows</refname>
|
|
<refpurpose>Get number of rows in result</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>int</type><methodname>mysql_num_rows</methodname>
|
|
<methodparam><type>resource</type><parameter>result</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Retrieves the number of rows from a result set. This command is only valid
|
|
for SELECT statements. To retrieve the number of rows affected by a INSERT,
|
|
UPDATE, or DELETE query, use <function>mysql_affected_rows</function>.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
&mysql.result.description;
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
The number of rows in a result set on success, or &false; on failure.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title><function>mysql_num_rows</function> example</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
|
|
$link = mysql_connect("localhost", "mysql_user", "mysql_password");
|
|
mysql_select_db("database", $link);
|
|
|
|
$result = mysql_query("SELECT * FROM table1", $link);
|
|
$num_rows = mysql_num_rows($result);
|
|
|
|
echo "$num_rows Rows\n";
|
|
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="notes">
|
|
&reftitle.notes;
|
|
<note>
|
|
<para>
|
|
If you use <function>mysql_unbuffered_query</function>,
|
|
<function>mysql_num_rows</function> will not return the
|
|
correct value until all the rows in the result set have been
|
|
retrieved.
|
|
</para>
|
|
</note>
|
|
<note>
|
|
<para>
|
|
&info.deprecated.alias;
|
|
<function>mysql_numrows</function>
|
|
</para>
|
|
</note>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>mysql_affected_rows</function></member>
|
|
<member><function>mysql_connect</function></member>
|
|
<member><function>mysql_data_seek</function></member>
|
|
<member><function>mysql_select_db</function></member>
|
|
<member><function>mysql_query</function></member>
|
|
</simplelist>
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
Local variables:
|
|
mode: sgml
|
|
sgml-omittag:t
|
|
sgml-shorttag:t
|
|
sgml-minimize-attributes:nil
|
|
sgml-always-quote-attributes:t
|
|
sgml-indent-step:1
|
|
sgml-indent-data:t
|
|
indent-tabs-mode:nil
|
|
sgml-parent-document:nil
|
|
sgml-default-dtd-file:"../../../../manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
vim: et tw=78 syn=sgml
|
|
vi: ts=1 sw=1
|
|
-->
|