2002-04-15 00:12:54 +00:00
|
|
|
<?xml version="1.0" encoding="iso-8859-1"?>
|
2004-07-26 14:02:10 +00:00
|
|
|
<!-- $Revision: 1.8 $ -->
|
2002-04-15 00:12:54 +00:00
|
|
|
<!-- splitted from ./en/functions/mysql.xml, last change in rev 1.2 -->
|
|
|
|
<refentry id="function.mysql-fetch-row">
|
|
|
|
<refnamediv>
|
|
|
|
<refname>mysql_fetch_row</refname>
|
|
|
|
<refpurpose>Get a result row as an enumerated array</refpurpose>
|
|
|
|
</refnamediv>
|
|
|
|
<refsect1>
|
|
|
|
<title>Description</title>
|
|
|
|
<methodsynopsis>
|
|
|
|
<type>array</type><methodname>mysql_fetch_row</methodname>
|
|
|
|
<methodparam><type>resource</type><parameter>result</parameter></methodparam>
|
|
|
|
</methodsynopsis>
|
|
|
|
<para>
|
|
|
|
Returns an array that corresponds to the fetched row, or &false;
|
|
|
|
if there are no more rows.
|
|
|
|
</para>
|
2004-07-26 14:02:10 +00:00
|
|
|
&database.fetch-null;
|
2002-04-15 00:12:54 +00:00
|
|
|
<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>
|
|
|
|
<para>
|
|
|
|
Subsequent call to <function>mysql_fetch_row</function> would
|
|
|
|
return the next row in the result set, or &false; if there are no
|
|
|
|
more rows.
|
|
|
|
</para>
|
2004-07-14 21:08:10 +00:00
|
|
|
<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>
|
2002-04-15 00:12:54 +00:00
|
|
|
<para>
|
2003-07-09 15:07:29 +00:00
|
|
|
See also
|
|
|
|
<function>mysql_fetch_array</function>,
|
|
|
|
<function>mysql_fetch_assoc</function>,
|
2002-04-15 00:12:54 +00:00
|
|
|
<function>mysql_fetch_object</function>,
|
|
|
|
<function>mysql_data_seek</function>,
|
2003-07-09 15:07:29 +00:00
|
|
|
<function>mysql_fetch_lengths</function> and
|
2002-04-15 00:12:54 +00:00
|
|
|
<function>mysql_result</function>.
|
|
|
|
</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
|
|
|
|
-->
|