2010-03-28 22:10:10 +00:00
|
|
|
<?xml version="1.0" encoding="utf-8"?>
|
2009-07-11 08:13:42 +00:00
|
|
|
<!-- $Revision$ -->
|
2007-06-20 22:25:43 +00:00
|
|
|
<refentry xml:id="function.mysql-field-flags" xmlns="http://docbook.org/ns/docbook">
|
2005-03-30 04:07:29 +00:00
|
|
|
<refnamediv>
|
|
|
|
<refname>mysql_field_flags</refname>
|
2005-03-31 07:47:25 +00:00
|
|
|
<refpurpose>Get the flags associated with the specified field in a result</refpurpose>
|
2005-03-30 04:07:29 +00:00
|
|
|
</refnamediv>
|
2005-03-31 07:47:25 +00:00
|
|
|
|
2012-06-05 07:55:24 +00:00
|
|
|
<refsynopsisdiv role="soft-deprecation-notice">
|
|
|
|
<sidebar>
|
|
|
|
&mysql.alternative.note;
|
|
|
|
<simplelist role="alternatives">
|
2012-06-05 08:29:31 +00:00
|
|
|
<member><function>mysqli_fetch_fields</function> [flags]</member>
|
|
|
|
<member><methodname>PDOStatement::getColumnMeta</methodname> [flags]</member>
|
2012-06-05 07:55:24 +00:00
|
|
|
</simplelist>
|
|
|
|
</sidebar>
|
|
|
|
</refsynopsisdiv>
|
|
|
|
|
2005-03-31 07:47:25 +00:00
|
|
|
<refsect1 role="description">
|
|
|
|
&reftitle.description;
|
2005-03-30 06:27:14 +00:00
|
|
|
<methodsynopsis>
|
|
|
|
<type>string</type><methodname>mysql_field_flags</methodname>
|
|
|
|
<methodparam><type>resource</type><parameter>result</parameter></methodparam>
|
|
|
|
<methodparam><type>int</type><parameter>field_offset</parameter></methodparam>
|
|
|
|
</methodsynopsis>
|
2005-03-30 04:07:29 +00:00
|
|
|
<para>
|
|
|
|
<function>mysql_field_flags</function> returns the field flags of
|
|
|
|
the specified field. The flags are reported as a single word
|
|
|
|
per flag separated by a single space, so that you can split the
|
|
|
|
returned value using <function>explode</function>.
|
|
|
|
</para>
|
2005-03-31 07:47:25 +00:00
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1 role="parameters">
|
|
|
|
&reftitle.parameters;
|
|
|
|
<para>
|
|
|
|
<variablelist>
|
|
|
|
&mysql.result.description;
|
|
|
|
&mysql.field-offset.req.description;
|
|
|
|
</variablelist>
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1 role="returnvalues">
|
|
|
|
&reftitle.returnvalues;
|
|
|
|
<para>
|
2009-11-09 10:26:08 +00:00
|
|
|
Returns a string of flags associated with the result&return.falseforfailure;.
|
2005-03-31 07:47:25 +00:00
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
The following flags are reported, if your version of MySQL
|
2005-03-30 04:07:29 +00:00
|
|
|
is current enough to support them: <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>,
|
2005-03-31 07:47:25 +00:00
|
|
|
<literal>"auto_increment"</literal> and <literal>"timestamp"</literal>.
|
2005-03-30 04:07:29 +00:00
|
|
|
</para>
|
2005-03-31 07:47:25 +00:00
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1 role="examples">
|
|
|
|
&reftitle.examples;
|
2005-03-30 04:07:29 +00:00
|
|
|
<para>
|
|
|
|
<example>
|
|
|
|
<title>A <function>mysql_field_flags</function> example</title>
|
|
|
|
<programlisting role="php">
|
2004-07-14 21:08:10 +00:00
|
|
|
<![CDATA[
|
|
|
|
<?php
|
|
|
|
$result = mysql_query("SELECT id,email FROM people WHERE id = '42'");
|
|
|
|
if (!$result) {
|
|
|
|
echo 'Could not run query: ' . mysql_error();
|
|
|
|
exit;
|
|
|
|
}
|
2005-01-13 12:54:17 +00:00
|
|
|
$flags = mysql_field_flags($result, 0);
|
2004-07-14 21:08:10 +00:00
|
|
|
|
2005-01-13 12:54:17 +00:00
|
|
|
echo $flags;
|
2004-07-14 21:08:10 +00:00
|
|
|
print_r(explode(' ', $flags));
|
2005-01-13 12:54:17 +00:00
|
|
|
?>
|
|
|
|
]]>
|
2005-03-30 04:07:29 +00:00
|
|
|
</programlisting>
|
|
|
|
&example.outputs.similar;
|
|
|
|
<screen>
|
2005-01-13 12:54:17 +00:00
|
|
|
<![CDATA[
|
2004-07-14 21:08:10 +00:00
|
|
|
not_null primary_key auto_increment
|
|
|
|
Array
|
|
|
|
(
|
|
|
|
[0] => not_null
|
|
|
|
[1] => primary_key
|
|
|
|
[2] => auto_increment
|
|
|
|
)
|
|
|
|
]]>
|
2005-03-30 04:07:29 +00:00
|
|
|
</screen>
|
|
|
|
</example>
|
|
|
|
</para>
|
2005-03-31 07:47:25 +00:00
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1 role="notes">
|
|
|
|
&reftitle.notes;
|
|
|
|
<note>
|
|
|
|
<para>
|
|
|
|
&info.deprecated.alias;
|
|
|
|
<function>mysql_fieldflags</function>
|
|
|
|
</para>
|
|
|
|
</note>
|
2005-03-30 04:07:29 +00:00
|
|
|
</refsect1>
|
2007-02-23 00:47:06 +00:00
|
|
|
|
|
|
|
<refsect1 role="seealso">
|
|
|
|
&reftitle.seealso;
|
|
|
|
<para>
|
|
|
|
<simplelist>
|
|
|
|
<member><function>mysql_field_type</function></member>
|
|
|
|
<member><function>mysql_field_len</function></member>
|
|
|
|
</simplelist>
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
|
2005-03-30 04:07:29 +00:00
|
|
|
</refentry>
|
2002-04-15 00:12:54 +00:00
|
|
|
|
|
|
|
<!-- 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
|
2009-09-25 07:04:39 +00:00
|
|
|
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
2002-04-15 00:12:54 +00:00
|
|
|
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
|
|
|
|
-->
|