php-doc-en/reference/mysql/functions/mysql-list-tables.xml
Georg Richter 01600c69a9 marked function as deprecated
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@120054 c90b9560-bf6c-de11-be94-00142212c4b1
2003-03-13 08:47:05 +00:00

99 lines
2.9 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.6 $ -->
<!-- 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.
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>.
</para>
<para>
The <parameter>database</parameter> parameter is the name of the
database to retrieve the list of tables from. Upon failure,
<function>mysql_list_tables</function> returns &false;.
</para>
<para>
For downward compatibility, the function alias named
<function>mysql_listtables</function> can be used. This is
deprecated however and is not recommended.
</para>
<para>
<note>
<simpara>
This function has been deprecated. Do not use this function.
Use the command SHOW TABLES FROM DATABASE instead.
</simpara>
</note>
</para>
<example>
<title><function>mysql_list_tables</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
$dbname = 'mysql_dbname';
if (!mysql_connect('mysql_host', 'mysql_user', 'mysql_password')) {
print 'Could not connect to mysql';
exit;
}
$result = mysql_list_tables($dbname);
if (!$result) {
print "DB Error, could not list tables\n";
print 'MySQL Error: ' . mysql_error();
exit;
}
while ($row = mysql_fetch_row($result)) {
print "Table: $row[0]\n";
}
mysql_free_result($result);
?>
]]>
</programlisting>
</example>
<para>
See also: <function>mysql_list_dbs</function>,
and <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
-->