ຫຼັກສາ PHP mysql_field_seek()
ການອະທິບາຍ ແລະ ການນໍາໃຊ້
ຫຼັກສາ mysql_field_seek() ຈະການການປ່ຽນຄວາມຄວາມນິຍົມໃນຕາມຄວາມກ່າວຫຼັງທີ່ກຳນົດຄວາມຄວາມນິຍົມພິຈາລະນາຫຼັງທີ່ກຳນົດ
ຖ້າສຳເລັດຈະກັບຄືນ true ຖ້າບໍ່ສຳເລັດຈະກັບຄືນ false。
ສັນຍາ
mysql_field_seek(data,field_offset)
ຫຼັກສາ | ອະທິບາຍ |
---|---|
data | ຕ້ອງການ。ຄວາມຂໍ້ມູນທີ່ຈະໃຊ້ກັບຄວາມຄວາມນິຍົມ mysql_query() The returned results. |
field_offset | Required. Indicates which field to start returning from. 0 indicates the first field. |
Example
<?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); // Skip to the fourth field mysql_field_seek($result,3); print_r(mysql_fetch_field($result)); mysql_close($con); ?>
Output:
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 )