php-doc-en/reference/mysql/functions/mysql-tablename.xml
2003-01-30 14:18:50 +00:00

67 lines
2.1 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.5 $ -->
<!-- splitted from ./en/functions/mysql.xml, last change in rev 1.2 -->
<refentry id="function.mysql-tablename">
<refnamediv>
<refname>mysql_tablename</refname>
<refpurpose>Get table name of field</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>string</type><methodname>mysql_tablename</methodname>
<methodparam><type>resource</type><parameter>result</parameter></methodparam>
<methodparam><type>int</type><parameter>i</parameter></methodparam>
</methodsynopsis>
<para>
<function>mysql_tablename</function> takes a result pointer
returned by the <function>mysql_list_tables</function> function
as well as an integer index and returns the name of a table. The
<function>mysql_num_rows</function> function may be used to
determine the number of tables in the result pointer.
Use the <function>mysql_tablename</function> function to
traverse this result pointer, or any function for result tables,
such as <function>mysql_fetch_array</function>.
<example>
<title><function>mysql_tablename</function> Example</title>
<programlisting role="php">
<![CDATA[
<?php
mysql_connect("localhost", "mysql_user", "mysql_password");
$result = mysql_list_tables("mydb");
for ($i = 0; $i < mysql_num_rows($result); $i++)
printf ("Table: %s\n", mysql_tablename($result, $i));
mysql_free_result($result);
?>
]]>
</programlisting>
</example>
</para>
<para>
See also: <function>mysql_list_tables</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
-->