I have the following bit of code:
ob_start();
$host="localhost"; // Host name
$username="admin"; // Mysql username
$password=""; // Mysql password
$db_name="my_db_m"; // Database name
$tbl_name="members"; // Table name
// Connect to server and select databse.
mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB :".mysql_error());
// Define $myusername and $mypassword
$myusername=$_POST['myusername'];
$mypassword=$_POST['mypassword'];
When I attempt to login, I get: cannot select DB :Access denied for user ''@'localhost' to database 'my_db_m'
I am using xampp. I used phpMyAdmin to create a database called 'my_db_m'. I created a table named 'members'.
Am I missing something? I am connecting to the mysql server yet unable to access the database...