-2
Good afternoon,
I need to make an INNER JOIN between 2 tables where each one is in a different database, but on the same server.
I have 1 table called "settings" and others called "customer launches" the column with is the "id" which is the primary key of settings.
I’ve searched a lot around here, but I can’t find a solution, or I don’t understand how it works.
I tried this and it didn’t work:
$sql01= ("SELECT * FROM $db1.definicao INNER JOIN $db2.lancamento_clientes ON $db1.definicao_variaveis.id = $db2.lancamento_clientes.id WHERE definicao_variaveis.id00 = '$id00' AND definicao_variaveis.nivel = '1' AND $id_tabela_base = $id_referencia_base ORDER BY definicao_variaveis.ordem");
while($linha01 = $sql01->fetch_assoc()) {echo $linha01['id'];}
But it didn’t work out, which I’m doing wrong, so somebody can help please. Thank you
Thank you. I already understood thank you, I thought DB1 and DB2 were the variables of connection to the Database.
– Rui Banha