mysql_field_seek的作用就是在mysql_query返回的記錄集中,調到我們指定的記錄上,如果有就返回當前記錄,沒有就是false;
mysql_field_seek語法:
mysql_field_seek(data,field_offset)
參數:
data:必須 指的是mysql_query正確返回的數據集.
field_offset:指定位置.不寫代碼從0開始
看個mysql_feild_seek實例.
<?
$sql = "SELECT * from Person";$result = mysql_query($sql,$con);mysql_field_seek($result,3);print_r(mysql_fetch_field($result));mysql_close($con);?>輸出結果.stdClass Object
(
[name] => Age
[table] => Person
[def] =>
[max_length] => 2
[not_null] => 0
[primary_key] => 0
[multiple_key] => 0
[unique_key] => 0
[numeric] => 1
[blob] => 0
[type] => int
[unsigned] => 0
[zerofill] => 0
)