Re: mysql_select_db() problem
| From: | Nick Wilson | Date: | Sat, 09 Feb 2002 20:56:26 +0000 |
| Subject: | Re: mysql_select_db() problem | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-84135@lists.php.net to get a copy of this message | ||
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
* and then Jeff Sheltren declared....
> It may be having a problem because you are not specifying which
> connection to use.
>
> perhaps try something like this:
>
> if(!$db = @mysql_connect("$dbhost", "$dbuser", "$dbpasswd"))
> die("An Error Occured. Unable to connect to the database.");
> if(!@mysql_select_db("$dbname",$db))
> die("An Error Occured. Unable to find the database $dbname on the
> MySQL server.");
No, that's not it. If you don't specify a link id then it assumes the
last connection or trys to establish one. (I've tried it anyway :-)
Come on guys, someone must be able to spot the 'gotcha'!
- --
Nick Wilson
Tel: +45 3325 0688
Fax: +45 3325 0677
Web: www.explodingnet.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
iD8DBQE8ZYz6HpvrrTa6L5oRAtwcAJ9FTvFFc57I7lUs8euOPp42nc6dZwCeMmis
UK+HqUaQ6fJlMUFWOlVsMZ8=
=ymec
-----END PGP SIGNATURE-----