Original MySQL API (
Mysql
)
2273
$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
Note
Field names returned by this function are case-sensitive.
Note
For backward compatibility, the following deprecated alias may be used:
mysql_fieldname
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
Warning
This extension is deprecated as of PHP 5.5.0, and will be removed in the
future. Instead, the
MySQLi
or
PDO_MySQL
extension should be used. See
also
MySQL: choosing an API
guide and
related FAQ
for more information.
Alternatives to this function include:
mysqli_field_seek
PDOStatement::fetch
using optional parameters
Description
bool mysql_field_seek(
resource result,
int field_offset);
Seeks to the specified field offset. If the next call to
mysql_fetch_field
doesn't include a field
offset, the field offset specified in
mysql_field_seek
will be returned.
Parameters
Summary of Contents for 5.0
Page 1: ...MySQL 5 0 Reference Manual ...
Page 18: ...xviii ...
Page 60: ...40 ...
Page 396: ...376 ...
Page 578: ...558 ...
Page 636: ...616 ...
Page 844: ...824 ...
Page 1234: ...1214 ...
Page 1427: ...MySQL Proxy Scripting 1407 ...
Page 1734: ...1714 ...
Page 1752: ...1732 ...
Page 1783: ...Configuring Connector ODBC 1763 ...
Page 1793: ...Connector ODBC Examples 1773 ...
Page 1839: ...Connector Net Installation 1819 2 You must choose the type of installation to perform ...
Page 2850: ...2830 ...
Page 2854: ...2834 ...
Page 2928: ...2908 ...
Page 3000: ...2980 ...
Page 3122: ...3102 ...
Page 3126: ...3106 ...
Page 3174: ...3154 ...
Page 3232: ...3212 ...