欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

PHP mysql_field_flags() 函數

定義和用法

mysql_field_flags() 函數從結果中取得和指定字段關聯的標志。

本函數返回指定字段的字段標志。

如果 MySQL 版本足夠新,則會支持以下的標志:

  • auto_intcrement
  • binary
  • blob
  • enum
  • multiple_key
  • not_null
  • primary_key
  • timestamp
  • unique_key
  • unsigned
  • zerofill

語法

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

提示和注釋

提示:每個標志都用一個單詞表示,之間用一個空格分開,因此,您可以通過 explode() 函數把返回的字符串打散到一個數組中。

例子

<?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);

$flags = mysql_field_flags($result, 0);
echo $flags;

mysql_close($con);
?>

輸出:

not_null primary_key auto_increment