mysql_field_seek()
bool mysql_field_seek(results,index)
Use this function to change the pointer to a different field from the results set given. The amount by which to offset the pointer is given as the second argument. Here is an example:
...
$sql_stmnt = "SELECT * FROM workreq LIMIT 1";
$results = mysql_db_query('workrequests', $sql_stmnt,
$connection);
$num_fields = mysql_num_fields($results);
mysql_field_seek($results, $num_fields - 3);
for ($index = 0; $index < 3; $index++) {
$field = mysql_fetch_field($results, $index);
print "$field->name \n";
}
...This example determines the number of fields and their values,
and then gives the result as the second argument of the
mysql_field_seek() function to choose the
last three fields of the results set. The for
statement prints out the field names of the last three fields using
mysql_fetch_field().