Ok, I'm just about to go insane here. I'm working on a little mySQL project, and I can't even get as far as having the "application" (such as it is at all of just a few lines at the moment) to select the database.
I've connected to the database fine, but when it comes time to select a database, it dies. I've looked everywhere, but kind figure out why it would be happening.
Anyone run into this problem before? Have any suggestions? I've tried multiple varations on the following code:
$hostname = "localhost";
$username = "USERNAME";
$password = "PASSWORD";
$dbName = "USERNAME_DATABASENAME";
/* MySQL table created to store the data */
$userstable = "mytable";
/* make connection to database */
mysql_connect($hostname,$username,$password) OR DIE("Unable to connect to database");
/* please note, I've also tried pconnect, either way, it connects to mySQL just fine… it's the next line that dies out no matter what…. */
mysql_select_db($dbName) or die("Unable to select database");
I've also tried using the function: mysql_selectdb, I've tried having the reference to the db connection stored in a variable ($db) and then doing:
mysql_select_db($dbName, $db)
I've tried putting $dbName in qoutes, $db in quotes, putting an "@" symbol before mysql_connect or mysql_pconnect, or before mysql_select_db (I have no idea what the significance of the "@" symbol is…
AAaaaah! Going. Insane.