I have been having a few problems trying to get an authorization script setup on a local intranet server.
I have added a user to the MySQL database to use to connect to the database through the script (mysqluser), and I also have made a table within a database to store the users that I want to be able to login to this section of the site ("sampledb" is the database, "sampletable" is the table name. Below is the part of the script that seems to be giving the error, I was just wondering if anyone could help me out.
$db_name = "sampledb";
$table_name = "sampletable";
$connection = mysql_connect('localhost', 'mysqluser', 'password')
or die("Couldn't connect.");
echo "$connection<br>";
$db = mysql_select_db($db_name, $connection)
or die("Couldn't select database.");
The problem is, when I fill in the login name and password, then press submit, I get the error...
Resource id #1
Couldn't select database.
If anyone could please help me out on this, it would be greatly appreciated.