See Bug #16187 The second parameter can't be used cause a number cannot be

used as an object property.  ie row->0 is invalid while row->field is, so
MYSQL_NUM and MYSQL_BOTH don't matter it should always be MYSQL_ASSOC.


git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@74383 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Chris Newbill 2002-03-20 22:21:29 +00:00
parent 23652e7aa9
commit 03522cb19f

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.92 $ -->
<!-- $Revision: 1.93 $ -->
<reference id="ref.mysql">
<title>MySQL Functions</title>
<titleabbrev>MySQL</titleabbrev>
@ -1134,9 +1134,6 @@ mysql_free_result($result);
<methodsynopsis>
<type>object</type><methodname>mysql_fetch_object</methodname>
<methodparam><type>resource</type><parameter>result</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>
result_type
</parameter></methodparam>
</methodsynopsis>
<para>
Returns an object with properties that correspond to the fetched
@ -1150,11 +1147,18 @@ mysql_free_result($result);
their offsets (numbers are illegal property names).
</para>
<para>
The optional argument <parameter>result_type</parameter> is a
constant and can take the following values: MYSQL_ASSOC,
MYSQL_NUM, and MYSQL_BOTH. See
<function>mysql_fetch_array</function> for explanation
of these constants.
<programlisting role="php">
<![CDATA[
<?php
// this is valid
echo $row->field;
// this is invalid
echo $row->0;
?>
]]>
</programlisting>
</para>
<para>
Speed-wise, the function is identical to