From f08927c92cc46d54832c2f92bc8a400db6314d88 Mon Sep 17 00:00:00 2001 From: Mehdi Achour <didou@php.net> Date: Sat, 16 Aug 2003 09:37:55 +0000 Subject: [PATCH] adding an example git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@137944 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/mysql/functions/mysql-select-db.xml | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/reference/mysql/functions/mysql-select-db.xml b/reference/mysql/functions/mysql-select-db.xml index a0f6af56da..fd5ad15f4d 100644 --- a/reference/mysql/functions/mysql-select-db.xml +++ b/reference/mysql/functions/mysql-select-db.xml @@ -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> @@ -30,6 +30,24 @@ 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 <function>mysql_connect</function>,