php-doc-en/reference/mysql/functions/mysql-field-len.xml
Nuno Lopes 3ff3381ba8 typos. noticed in user note
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@167827 c90b9560-bf6c-de11-be94-00142212c4b1
2004-09-02 09:08:40 +00:00

73 lines
2 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-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 value in email so for example
// user@example.com would give us a length of 16
$length = mysql_field_len($result, 'email');
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
-->