<?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.5 $ --> <!-- splitted from ./en/functions/mysql.xml, last change in rev 1.23 --> <refentry id="function.mysql-db-name"> <refnamediv> <refname>mysql_db_name</refname> <refpurpose>Get result data</refpurpose> </refnamediv> <refsect1> <title>Description</title> <methodsynopsis> <type>string</type><methodname>mysql_db_name</methodname> <methodparam><type>resource</type><parameter>result</parameter></methodparam> <methodparam><type>int</type><parameter>row</parameter></methodparam> <methodparam choice="opt"><type>mixed</type><parameter> field </parameter></methodparam> </methodsynopsis> <para> <function>mysql_db_name</function> takes as its first parameter the result pointer from a call to <function>mysql_list_dbs</function>. The <parameter>row</parameter> parameter is an index into the result set. </para> <para> If an error occurs, &false; is returned. Use <function>mysql_errno</function> and <function>mysql_error</function> to determine the nature of the error. </para> <para> <example> <title><function>mysql_db_name</function> example</title> <programlisting role="php"> <![CDATA[ <?php error_reporting(E_ALL); $link = mysql_connect('dbhost', 'username', 'password'); $db_list = mysql_list_dbs($link); $i = 0; $cnt = mysql_num_rows($db_list); while ($i < $cnt) { echo mysql_db_name($db_list, $i) . "\n"; $i++; } ?> ]]> </programlisting> </example> </para> <para> For backward compatibility, <function>mysql_dbname</function> is also accepted. This is deprecated, however. </para> <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 -->