Home  >  Article  >  Backend Development  >  PHP mysql_field_flags() example tutorial_PHP tutorial

PHP mysql_field_flags() example tutorial_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 17:04:061090browse

Definition and usage
The mysql_field_flags() function returns the flags of the field record.

This function gets the field data using the mysql_query() function and returns a string on success, or FALSE or on failure when there are no more rows.

Possible return values:

auto_intcrement -1 if set A UTO_INCREMENT
Binary -1 if the field has Binar attribute set
Spot -1 if it is a foreign B LOB
enum -1 if field is an enum field
multiple_key -1 if field is a non-unique key
not_null -1 if the field cannot be null
primary_key -1 if it is a foreign primary key
Timestamp -1 if field is a timestamp field
unique_key -1 if the field is a unique key
unsigned -1 if the field is unsigned
zerofill -1 if it is a foreign zero fill
Grammar

mysql_field_flags(data,field_offset)


data:. The specified data pointer is used. The data pointer is due to the field_offset requirement from the mysql_query() function. Specify which areas to start returning to. 0 indicates the first column to see an example.

$sql = "SELECT * from Person";
$result = mysql_query($sql,$con);

$flags = mysql_field_flags($result, 0);


echo $flags;

Output results.

not_null primary_key auto_increment

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/630895.htmlTechArticleDefinition and Usage The mysql_field_flags() function returns the flags of the field records. This function gets the field data mysql_query() function and returns a string on success, or...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn