php-doc-en/reference/mysql/functions/mysql-fetch-row.xml
Hannes Magnusson 07916c82c5 Send arguments to function via attributes
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@326070 c90b9560-bf6c-de11-be94-00142212c4b1
2012-06-09 19:04:39 +00:00

117 lines
3.1 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="function.mysql-fetch-row" xmlns="http://docbook.org/ns/docbook" xmlns:phd="http://www.php.net/ns/phd">
<refnamediv>
<refname>mysql_fetch_row</refname>
<refpurpose>Get a result row as an enumerated array</refpurpose>
</refnamediv>
<refsynopsisdiv role="soft-deprecation-notice">
<sidebar>
&mysql.alternative.note;
<simplelist role="alternatives">
<member><function>mysqli_fetch_row</function></member>
<member><methodname phd:args="PDO::FETCH_NUM">PDOStatement::fetch</methodname></member>
</simplelist>
</sidebar>
</refsynopsisdiv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>array</type><methodname>mysql_fetch_row</methodname>
<methodparam><type>resource</type><parameter>result</parameter></methodparam>
</methodsynopsis>
<para>
Returns a numerical array that corresponds to the fetched row
and moves the internal data pointer ahead.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
&mysql.result.description;
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns an numerical array of strings that corresponds to the fetched row, or
&false; if there are no more rows.
</para>
<para>
<function>mysql_fetch_row</function> fetches one row of data from
the result associated with the specified result identifier. The
row is returned as an array. Each result column is stored in an
array offset, starting at offset 0.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>Fetching one row with <function>mysql_fetch_row</function></title>
<programlisting role="php">
<![CDATA[
<?php
$result = mysql_query("SELECT id,email FROM people WHERE id = '42'");
if (!$result) {
echo 'Could not run query: ' . mysql_error();
exit;
}
$row = mysql_fetch_row($result);
echo $row[0]; // 42
echo $row[1]; // the email value
?>
]]>
</programlisting>
</example>
</para>
</refsect1>
<refsect1 role="notes">
&reftitle.notes;
&database.fetch-null;
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>mysql_fetch_array</function></member>
<member><function>mysql_fetch_assoc</function></member>
<member><function>mysql_fetch_object</function></member>
<member><function>mysql_data_seek</function></member>
<member><function>mysql_fetch_lengths</function></member>
<member><function>mysql_result</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:"~/.phpdoc/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
-->