cvs: phpdoc /en/reference/mysql/functions mysql-select-db.xml
| From: | Mehdi Achour | Date: | Sat, 16 Aug 2003 09:37:55 +0000 |
| Subject: | cvs: phpdoc /en/reference/mysql/functions mysql-select-db.xml | ||
| Groups: | php.doc | ||
| Request: | Send a blank email to phpdoc+get-969355821@lists.php.net to get a copy of this message | ||
didou Sat Aug 16 05:37:55 2003 EDT
Modified files:
/phpdoc/en/reference/mysql/functions mysql-select-db.xml
Log:
adding an example
Index: phpdoc/en/reference/mysql/functions/mysql-select-db.xml
diff -u phpdoc/en/reference/mysql/functions/mysql-select-db.xml:1.3
phpdoc/en/reference/mysql/functions/mysql-select-db.xml:1.4
--- phpdoc/en/reference/mysql/functions/mysql-select-db.xml:1.3 Wed Jul 9 11:07:29 2003
+++ phpdoc/en/reference/mysql/functions/mysql-select-db.xml Sat Aug 16 05:37:55 2003
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.3 $ -->
+<!-- $Revision: 1.4 $ -->
<!-- splitted from ./en/functions/mysql.xml, last change in rev 1.2 -->
<refentry id="function.mysql-select-db">
<refnamediv>
@@ -29,6 +29,24 @@
<para>
Every subsequent call to <function>mysql_query</function> will be
made on the active database.
+ </para>
+ <para>
+ <example>
+ <title><function>mysql_select_db</function> example</title>
+ <programlisting role="php">
+<![CDATA[
+<?php
+
+$lnk = mysql_connect('localhost', 'mysql_user', 'mysql_password')
+ or die ('Not connected : ' . mysql_error());
+
+// make foo the current db
+mysql_select_db('foo', $lnk) or die ('Can\'t use foo : ' . mysql_error());
+
+?>
+]]>
+ </programlisting>
+ </example>
</para>
<para>
See also