note 27251 added to function.mysql-select-db
| From: | rhcubevn at netdoor dot com | Date: | Fri, 29 Nov 2002 02:45:22 +0000 |
| Subject: | note 27251 added to function.mysql-select-db | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-40100@lists.php.net to get a copy of this message | ||
The previous post was a bad example. Here is a better example, with the optional resource parm:
<?php
$connection = mysql_connect($host, $user, $pass);
$db = mysql_select_db($mydatabase, $connection);
?>
The second paremeter in mysql_select_db is if you defined more than one mysql_connect(). You should
*always* define it, even if you only have one connection, as it is good practice, and will prevent
confusion later if you want to add another connection.
P.S. The first part of my e-mail (before @) is rot_13 encoded!
Armond
--
http://www.php.net/manual/en/function.mysql-select-db.php
http://master.php.net/manage/user-notes.php?action=edit+27251
http://master.php.net/manage/user-notes.php?action=delete+27251
http://master.php.net/manage/user-notes.php?action=reject+27251