I have created a MySQL join between two tables in two different databases on our account. The query works fine on my local server, but the host server doesn't like it. How can I make a connection to the second database, so the query works? Below is the error message with my code below that.
Query failed SQLSTATE[42000]: Syntax error or access violation: 1142 SELECT command denied to user 'someone'@'localhost' for table 'products'
Query
try {
$getPurch_info = $conn->prepare("
SELECT M.carrier, M.order_number, M.serial_number, M.tracking,
M.carrier, M_2.model FROM myDB_beta.purchases AS M
JOIN myDB2.products AS M_2 ON
M.product_ID = M_2.product_ID WHERE M.product_ID = ?");
$getPurch_info->execute(array($product_ID));
} catch (Exception $ex) {
die();
}