Relevant information:
Windows XP Pro SP2
PHP 5.0.2
MySQL 4.0.21-nt
command line (not server-side)

mysql_select_db returns no errors, and does not result in a mysql_error(), however, later queries result in errors suggesting that the switch failed:



//I'm having problems with mysql_select_db("DBNAME", resource) and
$test = mysql_query("use DBNAME", $resource);

//This results in no errors (I checked to make sure a true value was returned,
//and made sure mysql_errno() returned 0).
if(!$test || mysql_errno())
{
die("Error selecting DB");
}


//next, I'll make a query:
mysql_query("create table foo ( bar int, morebar int )", $resource);
if(mysql_errno())
{
 die(mysql_error());
}
//I get
//No Database Selected



There appear to be quite a few related/similar posts, but I can't find any that address this particular variant of the problem, which are solved.

Thanks
-Jim Stapleton


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to