I dont seem to be able to select the correct database.
here is the code i am using to connect.
$link = mysql_pconnect("localhost:/var/lib/mysql/mysql.sock", "", ""); // this line works fine...
$databaseName = "DRKit" // this is definately the correct DB name, we can access it in mysql prompt and do queries to it from there.
if (!($db = mysql_select_db("DRKit", $link)))
{
echo "Failed to connect to database";
}
$selectStmt = "Select * from DRproducts";
$result = mysql_query($selectStmt, $link);
$row = mysql_fetch_object ($result);
echo $row->Manufacturer;
the error that we receive everytime is
Failed to connect to database
Warning: Supplied argument is not a valid MySQL result resource in /usr/local/apache/htdocs/PHP/mysql.php on line 14
which we think is refering to the database name.
So I had a play around, and was able to use the mysql_db_name function to see that DRKit DID exist in the server, i even referenced this directly like...
if (!($db = mysql_select_db(mysql_db_name($db_list,0), $link)))
but even that didnt work...
help me someone :/
!!!
Baj