-
Notifications
You must be signed in to change notification settings - Fork 109
Expand file tree
/
Copy pathmysql-field-flags.xml
More file actions
126 lines (117 loc) · 3.57 KB
/
Copy pathmysql-field-flags.xml
File metadata and controls
126 lines (117 loc) · 3.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: 15d88bef8b9082fb92a3753a9e7551f9cf1836d3 Maintainer: dallas Status: ready -->
<!-- CREDITS: mowangjuanzi -->
<refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.mysql-field-flags">
<refnamediv>
<refname>mysql_field_flags</refname>
<refpurpose>从结果中取得和指定字段关联的 flags</refpurpose>
</refnamediv>
<refsynopsisdiv>
<warning>
&mysql.alternative.note;
<simplelist role="alternatives">
<member><function>mysqli_fetch_field_direct</function> [flags]</member>
<member><methodname>PDOStatement::getColumnMeta</methodname> [flags]</member>
</simplelist>
</warning>
</refsynopsisdiv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type class="union"><type>string</type><type>false</type></type><methodname>mysql_field_flags</methodname>
<methodparam><type>resource</type><parameter>result</parameter></methodparam>
<methodparam><type>int</type><parameter>field_offset</parameter></methodparam>
</methodsynopsis>
<simpara>
<function>mysql_field_flags</function> 返回指定字段的字段 flags。每个 flag 都用一个单词表示,之间用一个空格分开,因此可以用
<function>explode</function> 将返回值分开。
</simpara>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<variablelist>
&mysql.result.description;
&mysql.field-offset.req.description;
</variablelist>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<simpara>
Returns a string of flags associated with the result&return.falseforfailure;.
</simpara>
<simpara>
如果 MySQL 版本足够新,以便支持这些 flag,则会报告以下
flag:<literal>"not_null"</literal>、<literal>"primary_key"</literal>、<literal>"unique_key"</literal>、<literal>"multiple_key"</literal>、<literal>"blob"</literal>、<literal>"unsigned"</literal>、<literal>"zerofill"</literal>,<literal>"binary"</literal>、<literal>"enum"</literal>、<literal>"auto_increment"</literal>
和 <literal>"timestamp"</literal>。
</simpara>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<example>
<title><function>mysql_field_flags</function> 示例</title>
<programlisting role="php">
<![CDATA[
<?php
$result = mysql_query("SELECT id,email FROM people WHERE id = '42'");
if (!$result) {
echo 'Could not run query: ' . mysql_error();
exit;
}
$flags = mysql_field_flags($result, 0);
echo $flags;
print_r(explode(' ', $flags));
?>
]]>
</programlisting>
&example.outputs.similar;
<screen>
<![CDATA[
not_null primary_key auto_increment
Array
(
[0] => not_null
[1] => primary_key
[2] => auto_increment
)
]]>
</screen>
</example>
</refsect1>
<refsect1 role="notes">
&reftitle.notes;
<note>
<simpara>
&info.deprecated.alias;
<function>mysql_fieldflags</function>
</simpara>
</note>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<simplelist>
<member><function>mysql_field_type</function></member>
<member><function>mysql_field_len</function></member>
</simplelist>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->