How do I display information from two different databases?

Good afternoon. Tell me, please. I need to get information from two different databases
There are 2 identical tables Have the same columns
name, id
<?php
$direct = '/connect.php';

require_once $direct;

$link = mysqli_connect($host, $user, $password, $database) 
 or die("Error" . mysqli_error($link));

mysql_select_db(db,$link); 

$link1 = mysqli_connect($host1, $user1, $password1, $database1) 
 or die("Error" . mysqli_error($link1));

mysql_select_db(db2,$link1);

$query ="SELECT name FROM db.name inner join db2.name ORDER BY id";

$result = mysqli_query($link, $query) or die("Error" . mysqli_error($link)); 

?>

Error SELECT command denied to user
June 8th 19 at 17:23
1 answer
June 8th 19 at 17:25
Let the user, which are in the database, the right to SELECT query.
There is a law. If you remove the connection to the second database, then everything is fine. - sylvan.Ho commented on June 8th 19 at 17:28

Find more questions by tags PHPSQL