I know how to join table or database but the problem is that my database is on a different domain. So when we can make a connection for any DB that's fine but now we have to join with DB and table so in my mysqli_query.
So it only lets us select one connection and other the connection query had failed, code is below is there any trick on how to cover this problem, NOTE both connection have different login detail
$connect_db = mysqli_connect(DB_SERVER,DB_USERNAME,DB_PASSWORD,DB_DATABASE);
$connect_db_1 = mysqli_connect(DB_SERVER_1,DB_USERNAME_1,DB_PASSWORD_1,DB_DATABASE_1);
$m_db = mysqli_query($connect_db_1,"INSERT INTO shopcord.table (userid,title,username,groupid,last_login,status,is_email_confirmed) $connect_db, SELECT id,'Member',person_name,'0','$uk_date','inactive','0' FROM onlineshoping.table WHERE id = '31'");
if ( !$m_db ) {
echo 'one';
exit();
} else {
echo 'two';
exit();
}