1
I set up a table with Data that nay should be sought, I’ll call you here Table. The data that was in this table are these:
|Tabela_Not|
Londres
Tóquio
Paris
And I applied this Query to make the searches discarding the items from Table:
SELECT * FROM BancoANoServidor1.registros WHERE Papel NOT IN (SELECT Papel FROM BancoANoServidor1.Tabela_Not);
As you can see in Query, the two tables are in the same database/server, my question is, the table records where I would like to do this search is on another Server (Bancobnoservier2.records).
Is there a way to solve this using only Mysql? Or is there another way to solve it in PHP? There is a way to do something like:
$Query_not = "SELECT Papel FROM BancoANoServidor1.Tabela_Not";
$result_not = mysqli_query($conecta1, $Query_not);
$Query_return = "SELECT * FROM BancoBNoServidor2.registros WHERE Papel NOT IN ($result_not)";
$return = mysqli_query($conecta2, $Query_return);
You’ll make a mistake because you’ll get a comma at the end not?
– Geraldão de Rívia
@Shinchila_matadora this code does not work, but can be recycled logic.
– Don't Panic
$deny = substr($deny , 0, strlen(deny)-1);
– Claudio Scarpa Filho
@Claudioscarpafilho, I will try to implement here, thank you very much
– Geraldão de Rívia