mysql_field_seek

(PHP 3, PHP 4 , PHP 5)

mysql_field_seek --  Set result pointer to a specified field offset

Description

int 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.

See also mysql_fetch_field().

/> *   user_id
*   username
*   password.
*/
$link = mysql_connect('localhost', 'mysql_user', 'mysql_password');
if (!
$db_selected) {
    die(
'Could not set $dbname: ' . mysql_error());
}
$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);
?>