oops, i forgot a @ for mysql_connect() but oh
well, you get the point :)
Regards,
Philip Olson
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
> The following code always returns the "Couldn't select
> database" error.
> $db_name="mydb";
> $table_name="my_table";
> $connection = @mysql_connect("localhost", "user", "password") or die
> ("Couldn't connect.");
> $db = @mysql_select_db($db_name) or die ("Couldn't select database");
> ?>
uot;stamps") or die("Could not select database");
This works.
Regards
Peter Goggin
- Original Message -
From: "PossumPal" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, June 03, 2002 4:40 AM
Subject: [PHP] mysql_select_db problem
Hi,
I
ouldn't hurt to try :-)
Cheers,
# Nathan
- Original Message -
From: "PossumPal" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, June 02, 2002 12:40 PM
Subject: [PHP] mysql_select_db problem
Hi,
I'm a newbie, so please have mercy on my silliness
Hi,
I'm a newbie, so please have mercy on my silliness...
I've checked my formats, and can't seem to understand why I can connect to the db, but
not select the db that I want to use. The following code always returns the "Couldn't
select database" error.
If I use the mysql monitor, I can s
> > What do you get if you use error checking?
>
> Well, that seems to be it, I'm getting 'Access deneid to user
> '@localhost'.
>
> I'm talking to a guy on the mysql list, apparently it is a
> phenomememememememmemonmmm that when you GRANT ALL using wildcards it
> tends to grant all on * exce
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
* and then Lars Torben Wilson declared
> I take it that the connection worked fine? (Yeah, dumb question, but you
> never know.)
Yeah, all is well as far as connections concerned.
> What do you get if you use error checking?
Well, that seems t
On Sat, 2002-02-09 at 12:24, Nick Wilson wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> Hi all,
> I just can't see what could possibly be wrong with my php here:
>
> $sel_db=mysql_select_db("mydb") or die
> ("could not get the bugger");
> exit;
>
> I can
-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
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 Er
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Hi all,
I just can't see what could possibly be wrong with my php here:
$sel_db=mysql_select_db("mydb") or die
("could not get the bugger");
exit;
I can 'USE mydb' just fine from the command line so what's the problem?
11 matches
Mail list logo