mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-19 18:38:55 +00:00

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@169455 c90b9560-bf6c-de11-be94-00142212c4b1
90 lines
2.6 KiB
XML
90 lines
2.6 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision: 1.4 $ -->
|
|
<!-- splitted from ./en/functions/mysql.xml, last change in rev 1.17 -->
|
|
<refentry id="function.mysql-field-flags">
|
|
<refnamediv>
|
|
<refname>mysql_field_flags</refname>
|
|
<refpurpose>
|
|
Get the flags associated with the specified field in a result
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<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>
|
|
<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>
|
|
<para>The following flags are reported, if your version of MySQL
|
|
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>,
|
|
<literal>"auto_increment"</literal> et <literal>"timestamp"</literal>.
|
|
</para>
|
|
<para>
|
|
<example>
|
|
<title>A <function>mysql_field_flags</function> example</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, 'id');
|
|
|
|
print $flags;
|
|
print_r(explode(' ', $flags));
|
|
|
|
/* Output will look similar to:
|
|
|
|
not_null primary_key auto_increment
|
|
Array
|
|
(
|
|
[0] => not_null
|
|
[1] => primary_key
|
|
[2] => auto_increment
|
|
)
|
|
|
|
*/
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
<para>
|
|
For downward compatibility <function>mysql_fieldflags</function>
|
|
can also be used. This is deprecated, however.
|
|
</para>
|
|
</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:"../../../../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
|
|
-->
|