php-doc-en/reference/mysql/functions/mysql-list-tables.xml
Georg Richter e551e7bc3f inserted new sample
inserted see also


git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@79311 c90b9560-bf6c-de11-be94-00142212c4b1
2002-04-21 15:18:45 +00:00

75 lines
2.2 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.3 $ -->
<!-- splitted from ./en/functions/mysql.xml, last change in rev 1.2 -->
<refentry id="function.mysql-list-tables">
<refnamediv>
<refname>mysql_list_tables</refname>
<refpurpose>List tables in a MySQL database</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>resource</type><methodname>mysql_list_tables</methodname>
<methodparam><type>string</type><parameter>database</parameter></methodparam>
<methodparam choice="opt"><type>resource</type><parameter>
link_identifier
</parameter></methodparam>
</methodsynopsis>
<para>
<function>mysql_list_tables</function> takes a database name and
returns a result pointer much like the
<function>mysql_query</function> function. You can use the
<function>mysql_tablename</function> function to extract the
actual table names from the result pointer, or any other result
table function.
</para>
<para>
For downward compatibility <function>mysql_listtables</function>
can also be used. This is deprecated however.
</para>
<example>
<title>mysql_list_tables Example</title>
<programlisting role="php">
<![CDATA[
<?php
mysql_connect("localhost", "mysql_user", "mysql_password") or
die("could not connect");
mysql_select_db("mydb");
$result = mysql_list_tables();
while (($row = mysql_fetch_row($result))
printf ("Table: %s\n", $row[0]);
mysql_free_result($result);
?>
]]>
</programlisting>
</example>
<para>
See also: <function>mysql_list_dbs</function>,
<function>mysql_tablename</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
-->