I am trying to write PHP code where I connect to two different databases.
On the first database I run a query and get a column (for e.g. column output: 1,2,3,4,5), now I need to feed 1,2,3,4,5 into a second SQL query which has a statement like:
select key from table where foo = '1','2','3','4','5'
How it can be done in PHP?
It looks like you’re looking for the MySQL IN Clause
That doesn’t really have to anything with PHP, or I don’t really get what you mean. Anyway:
Those lines of pseudo code (without validation) should get you started.