mysql如何跳到指定記錄 mysql_field_seek教程_PHP教程

來源:互聯網
上載者:User
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
)
 
 
 

http://www.bkjia.com/PHPjc/630892.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/630892.htmlTechArticlemysql_field_seek的作用就是在mysql_query返回的記錄集中,調到我們指定的記錄上,如果有就返回目前記錄,沒有就是false; mysql_field_seek文法: mysql_fi...

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.