I have a few simple lines of code to connect to a database from my web page, (code based on Kyank's tutorials). The code runs as follows:

<?php

// Connect to the database server
$dbcnx = @mysql_connect("localhost","-----", "-----");
if (!$dbcnx) {
echo( "<br>Unable to connect to the " .
"database server at this time." );
exit();
}
else echo ("Server connect... ok.");


// Select the projects database
$dbsel = @mysql_select_db("projects");
if (!$dbsel) {
echo( "<br>Unable to locate the project " .
"database at this time." );
exit();
}
else echo ("<br>Database connect... ok.");

?>

I get the "Server connect ok" line, but always receive the "unable to connect to projects database" line after.
I have double-checked the name of the database, the location certainly is correct, and I've even been able to modify the db with phpMyAdmin even when this code says the db is unavailable. Thus, I figure my code is buggy somehow, but I just can't see it.
Help, anyone? Thanx


------------------
mp
www.honeyb.com