2010-03-28 22:10:10 +00:00
|
|
|
<?xml version="1.0" encoding="utf-8"?>
|
2009-07-11 08:13:42 +00:00
|
|
|
<!-- $Revision$ -->
|
2007-06-20 22:25:43 +00:00
|
|
|
<refentry xml:id="function.mysql-db-name" xmlns="http://docbook.org/ns/docbook">
|
2005-03-30 04:07:29 +00:00
|
|
|
<refnamediv>
|
|
|
|
<refname>mysql_db_name</refname>
|
2011-05-30 09:07:30 +00:00
|
|
|
<refpurpose>Retrieves database name from the call to <function>mysql_list_dbs</function></refpurpose>
|
2005-03-30 04:07:29 +00:00
|
|
|
</refnamediv>
|
2007-01-28 05:22:02 +00:00
|
|
|
|
2005-03-30 08:14:56 +00:00
|
|
|
<refsect1 role="description">
|
|
|
|
&reftitle.description;
|
2005-03-30 06:27:14 +00:00
|
|
|
<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>
|
2005-03-30 04:07:29 +00:00
|
|
|
<para>
|
2005-03-30 08:14:56 +00:00
|
|
|
Retrieve the database name from a call to
|
|
|
|
<function>mysql_list_dbs</function>.
|
2005-03-30 04:07:29 +00:00
|
|
|
</para>
|
2005-03-30 08:14:56 +00:00
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1 role="parameters">
|
|
|
|
&reftitle.parameters;
|
|
|
|
<para>
|
|
|
|
<variablelist>
|
|
|
|
<varlistentry>
|
|
|
|
<term><parameter>result</parameter></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
The result pointer from a call to <function>mysql_list_dbs</function>.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
|
|
|
<term><parameter>row</parameter></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
The index into the result set.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
|
|
|
<term><parameter>field</parameter></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
The field name.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1 role="returnvalues">
|
|
|
|
&reftitle.returnvalues;
|
2005-03-30 04:07:29 +00:00
|
|
|
<para>
|
2005-03-30 08:14:56 +00:00
|
|
|
Returns the database name on success, and &false; on failure. If &false;
|
|
|
|
is returned, use <function>mysql_error</function> to determine the nature
|
|
|
|
of the error.
|
2005-03-30 04:07:29 +00:00
|
|
|
</para>
|
2005-03-30 08:14:56 +00:00
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1 role="examples">
|
|
|
|
&reftitle.examples;
|
2005-03-30 04:07:29 +00:00
|
|
|
<para>
|
|
|
|
<example>
|
|
|
|
<title><function>mysql_db_name</function> example</title>
|
|
|
|
<programlisting role="php">
|
2002-04-15 00:12:54 +00:00
|
|
|
<![CDATA[
|
|
|
|
<?php
|
2004-01-05 13:03:26 +00:00
|
|
|
error_reporting(E_ALL);
|
2002-04-15 00:12:54 +00:00
|
|
|
|
2004-01-05 13:03:26 +00:00
|
|
|
$link = mysql_connect('dbhost', 'username', 'password');
|
|
|
|
$db_list = mysql_list_dbs($link);
|
2002-04-15 00:12:54 +00:00
|
|
|
|
2004-01-05 13:03:26 +00:00
|
|
|
$i = 0;
|
|
|
|
$cnt = mysql_num_rows($db_list);
|
|
|
|
while ($i < $cnt) {
|
|
|
|
echo mysql_db_name($db_list, $i) . "\n";
|
|
|
|
$i++;
|
|
|
|
}
|
2002-04-15 00:12:54 +00:00
|
|
|
?>
|
|
|
|
]]>
|
2005-03-30 04:07:29 +00:00
|
|
|
</programlisting>
|
|
|
|
</example>
|
|
|
|
</para>
|
2005-03-30 08:14:56 +00:00
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1 role="notes">
|
|
|
|
&reftitle.notes;
|
|
|
|
<note>
|
|
|
|
<para>
|
2005-03-31 07:47:25 +00:00
|
|
|
&info.deprecated.alias;
|
|
|
|
<function>mysql_dbname</function>
|
2005-03-30 08:14:56 +00:00
|
|
|
</para>
|
|
|
|
</note>
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1 role="seealso">
|
|
|
|
&reftitle.seealso;
|
2005-03-30 04:07:29 +00:00
|
|
|
<para>
|
2005-03-30 08:14:56 +00:00
|
|
|
<simplelist>
|
|
|
|
<member><function>mysql_list_dbs</function></member>
|
|
|
|
<member><function>mysql_tablename</function></member>
|
|
|
|
</simplelist>
|
2005-03-30 04:07:29 +00:00
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
</refentry>
|
2002-04-15 00:12:54 +00:00
|
|
|
|
|
|
|
<!-- 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
|
2009-09-25 07:04:39 +00:00
|
|
|
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
2002-04-15 00:12:54 +00:00
|
|
|
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
|
|
|
|
-->
|