mysql_field_seek

mysql_field_seek() 函式將結果集中的指針設定為指定的欄位偏移量

基本介紹

  • 外文名:mysql_field_seek
  • 性質:函式
  • 語法:mysql_field_seek(data,field)
  • 領域:程式設計
用法,詳情,語法,例子,

用法

如果成功,則返回 true,如果失敗,則返回 false。

詳情

語法

mysql_field_seek(data,field_offset)
參數
描述
data
必需。要使用的數據指針。該數據指針是從 mysql_query() 返回的結果。
field_offset
必需。指示從哪個欄位開始返回。0 指示第一個欄位。

例子

<?php
$con = mysql_connect("localhost", "hello", "321");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
$db_selected = mysql_select_db("test_db",$con);
$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
)

相關詞條

熱門詞條

聯絡我們