I tried to connect two databases in single php file and tried to retrieve data by joining tables of both databases. Here is my code
require_once "connect.php";
require_once "connect_college.php";
$sql = "select * from college_db.students join mini-project.exam on students.adno=exam.adno and students.receipt=exam.receipt ";
if (!mysql_query($sql))
{
die('Error');
}
else
{
header("Location: generate.php");
exit();
}
Mysql query is not running. college_db and mini-project are the two databases.