ฟังก์ชั่น mysql_field_len()
ความหมายของฟังก์ชั่นและการใช้งาน
การคืนค่าขนาดข้อมูลของคอลัมน์ที่กำหนด ใน result โดยจะคืนค่า false กรณีที่เกิดความผิดพลาด ด้วยฟังก์ชั่น mysql_field_len()
รูปแบบการเขียน (Syntax)
int mysql_field_len ( resource $result , int $field_offset )
ตัวอย่างที่ 1
<?php
$result = mysql_query("SELECT id,email FROM people WHERE id = '42'");
if (!$result) {
echo 'Could not run query: ' . mysql_error();
exit;
}
// Will get the length of the id field as specified in the database
// schema.
$length = mysql_field_len($result, 0);
echo $length;
?>