I'm new to MySQL
and PHP
and using 5.0 version of php. My requirement is to connect to a MySQL
database which is located on another server (www.some-domain.com). My PHP
files are located in my local system.
I have remote server database
credentials. How do I configure these details into the PHP
file ?
Here is my code so far:
mysql_connect("remote server ip", "root", "root123") or die (mysql_error ());
// Select database
mysql_select_db("resource") or die(mysql_error());
// SQL query
$strSQL = "SELECT * FROM resource WHERE resource_type=11";
// Execute the query (the recordset $rs contains the result)
$rs = mysql_query($strSQL);
when i use above code getting below error:
Access denied for user 'root'@'%' to database 'resource'