วันอังคารที่ 9 ธันวาคม พ.ศ. 2557

mysql_fetch_field()

Mysql Function: mysql_fetch_field()
function:  mysql_fetch_field ( result, column );
return type:  object
content:  ใช้คืนค่า รายละเอียด ของคอลัมน์ที่กำหนด ใน result แล้วเก็บไว้ที่ object
โดยมี property ได้แก่ name, table, def, max_length, type, not_null,
primary_key, unique_key, multiple_key, numeric, blob, unsigned, zerofill
example:  $conn = mysql_connect ( "localhost", "root", "1234" );
$sql = "SELECT * FROM employee INNER JOIN position ON employee.position_id = position.id";
$result = mysql_db_query ( "dblabcode", $sql, $conn );
while ( $record = mysql_fetch_field ( $result ) )
{
     echo $record->name . " " . $record->type . " " . $record->max_length;

}

ไม่มีความคิดเห็น:

แสดงความคิดเห็น