php-doc-en/reference/mysql/functions/mysql-field-len.xml
Philip Olson 00fa1c917a Fix example.
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@183202 c90b9560-bf6c-de11-be94-00142212c4b1
2005-03-30 19:23:51 +00:00

73 lines
1.9 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.7 $ -->
<!-- splitted from ./en/functions/mysql.xml, last change in rev 1.17 -->
<refentry id="function.mysql-field-len">
<refnamediv>
<refname>mysql_field_len</refname>
<refpurpose>
Returns the length of the specified field
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>int</type><methodname>mysql_field_len</methodname>
<methodparam><type>resource</type><parameter>result</parameter></methodparam>
<methodparam><type>int</type><parameter>field_offset</parameter></methodparam>
</methodsynopsis>
<para>
<function>mysql_field_len</function> returns the length of the
specified field.
</para>
<para>
<example>
<title><function>mysql_field_len</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;
}
// Will get the length of the id field as specified in the database
// schema.
$length = mysql_field_len($result, 0);
echo $length;
?>
]]>
</programlisting>
</example>
</para>
<para>
For downward compatibility <function>mysql_fieldlen</function>
can also be used. This is deprecated, however.
</para>
<para>
See also <function>mysql_fetch_lengths</function> and
<function>strlen</function>.
</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
-->