Files
php-doc-ru/reference/mysql/functions/mysql-list-tables.xml
Shein Alexey 2d1090ebc1 Updated translation.
git-svn-id: https://svn.php.net/repository/phpdoc/ru/trunk@311652 c90b9560-bf6c-de11-be94-00142212c4b1
2011-05-31 11:28:37 +00:00

159 lines
4.1 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: 0640e024d4b8a9400d457143ccd0ea66e5f98ead Maintainer: shein Status: ready -->
<!-- Reviewed: no -->
<!-- $Revision$ -->
<refentry xml:id="function.mysql-list-tables" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>mysql_list_tables</refname>
<refpurpose>Возвращает список таблиц базы данных MySQL</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<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>
Возвращает список имен таблиц базы данных MySQL.
</para>
<para>
Данная функция устарела. Вместо нее рекомендуется использовать
<function>mysql_query</function> с запросом
<literal>SHOW TABLES [FROM db_name] [LIKE 'pattern']</literal>.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>database</parameter></term>
<listitem>
<para>
Имя базы данных
</para>
</listitem>
</varlistentry>
&mysql.linkid.description;
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Дескриптор результата (<type>resource</type>) в случае успеха&return.falseforfailure;.
</para>
<para>
Используйте функцию <function>mysql_tablename</function>
для работы с результатом запроса, либо любую другую функцию,
способную это делать, например,
<function>mysql_fetch_array</function>.
</para>
</refsect1>
<refsect1 role="changelog">
&reftitle.changelog;
<para>
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>&Version;</entry>
<entry>&Description;</entry>
</row>
</thead>
<tbody>
<row>
<entry>4.3.7</entry>
<entry>
Функция помечена устаревшей.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>Пример использования <function>mysql_list_tables</function></title>
<programlisting role="php">
<![CDATA[
<?php
$dbname = 'mysql_dbname';
if (!mysql_connect('mysql_host', 'mysql_user', 'mysql_password')) {
echo 'Ошибка подключения к mysql';
exit;
}
$sql = "SHOW TABLES FROM $dbname";
$result = mysql_query($sql);
if (!$result) {
echo "Ошибка базы, не удалось получить список таблиц\n";
echo 'Ошибка MySQL: ' . mysql_error();
exit;
}
while ($row = mysql_fetch_row($result)) {
echo "Таблица: {$row[0]}\n";
}
mysql_free_result($result);
?>
]]>
</programlisting>
</example>
</para>
</refsect1>
<refsect1 role="notes">
&reftitle.notes;
<note>
<para>
&info.deprecated.alias;
<function>mysql_listtables</function>
</para>
</note>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>mysql_list_dbs</function></member>
<member><function>mysql_tablename</function></member>
</simplelist>
</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:"~/.phpdoc/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
-->