Some options:
1 Assuming you have a user who has access to all 3 databases (on the same server). Then, make a query with INNER JOIN searching Ips that occur in the 3 banks.
SELECT *
FROM db1.tabela_ips AS a
INNER JOIN db2.tabela_ips b ON a.num_ip = b.num_ip
INNER JOIN db3.tabela_ips c ON b.num_ip = c.num_ip
In this case, only the Ips that occur in the 3 banks will be displayed.
2 Starting from the same previous premise, this query generates a single list of all data and then removes duplicate items.
SELECT DISTINCT ip
FROM (
SELECT * FROM db1.tabela_ips
UNION
SELECT * FROM db2.tabela_ips
UNION
SELECT * FROM db3.tabela_ips
) t
3 If each database has a unique user, then you make a PHP script that connects and fetches the data from the 3 databases and then use a function array_merge
to merge the 3 lists and exclude duplicates (as in case 2).
Assemble an array that groups the ips of all databases.
– Rodrigo Brandão