Oracle 5.0 Reference Manual page 2283

Table of Contents

Advertisement

}
if (mysql_num_rows($result) == 0) {
echo "No rows found, nothing to print so am exiting";
exit;
}
// While a row of data exists, put that row in $row as an associative array
// Note: If you're expecting just one row, no need to use a loop
// Note: If you put extract($row); inside the following loop, you'll
//
then create $userid, $fullname, and $userstatus
while ($row = mysql_fetch_assoc($result)) {
echo $row["userid"];
echo $row["fullname"];
echo $row["userstatus"];
}
mysql_free_result($result);
?>
Notes
See Also
mysql_fetch_row
mysql_fetch_array
mysql_data_seek
mysql_query
mysql_error
20.7.2.5.15.
mysql_fetch_field
Copyright 1997-2012 the PHP Documentation Group. [2230]
mysql_fetch_field
Get column information from a result and return as an object
Original MySQL API (Mysql)
Performance
An important thing to note is that using
significantly slower than using mysql_fetch_row, while it provides a
significant added value.
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_field
PDOStatement::getColumnMeta
mysql_fetch_assoc
NULL
or
PDO_MySQL
extension should be used. See
guide and
related FAQ
2263
is not
value.
for more information.

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents