Oracle 5.0 Reference Manual page 2288

Table of Contents

Advertisement

$result = mysql_query("select name from mytable limit 1");
$obj = mysql_fetch_object($result, 'foo');
var_dump($obj);
?>
Notes
See Also
mysql_fetch_array
mysql_fetch_assoc
mysql_fetch_row
mysql_data_seek
mysql_query
20.7.2.5.18.
mysql_fetch_row
Copyright 1997-2012 the PHP Documentation Group. [2230]
mysql_fetch_row
Get a result row as an enumerated array
Description
array mysql_fetch_row(
resource result);
Returns a numerical array that corresponds to the fetched row and moves the internal data pointer
ahead.
Original MySQL API (Mysql)
Performance
Speed-wise, the function is identical to mysql_fetch_array, and almost as
quick as
mysql_fetch_row
Note
mysql_fetch_object
- an object is returned, instead of an array. Indirectly, that means that you can
only access the data by the field names, and not by their offsets (numbers are
illegal property names).
Note
Field names returned by this function are case-sensitive.
Note
This function sets NULL fields to the PHP
Warning
This extension is deprecated as of PHP 5.5.0, and will be removed in the
future. Instead, the
MySQLi
also
MySQL: choosing an API
Alternatives to this function include:
mysqli_fetch_row
PDOStatement::fetch(PDO::FETCH_NUM)
(the difference is insignificant).
is similar to mysql_fetch_array, with one difference
NULL
or
PDO_MySQL
extension should be used. See
guide and
related FAQ
2268
value.
for more information.

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents