Oracle 5.0 Reference Manual page 2293

Table of Contents

Advertisement

$dbname = 'mydb';
$db_selected = mysql_select_db($dbname, $link);
if (!$db_selected) {
die("Could not set $dbname: " . mysql_error());
}
$res = mysql_query('select * from users', $link);
echo mysql_field_name($res, 0) . "\n";
echo mysql_field_name($res, 2);
?>
The above example will output:
user_id
password
Notes
See Also
mysql_field_type
mysql_field_len
20.7.2.5.22.
mysql_field_seek
Copyright 1997-2012 the PHP Documentation Group. [2230]
mysql_field_seek
Set result pointer to a specified field offset
Description
bool mysql_field_seek(
resource result,
int field_offset);
Seeks to the specified field offset. If the next call to
offset, the field offset specified in
Parameters
Original MySQL API (Mysql)
Note
Field names returned by this function are case-sensitive.
Note
For backward compatibility, the following deprecated alias may be used:
mysql_fieldname
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_field_seek
PDOStatement::fetch
mysql_field_seek
or
PDO_MySQL
extension should be used. See
guide and
related FAQ
using optional parameters
mysql_fetch_field
will be returned.
2273
for more information.
doesn't include a field

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents