You can't.
I PHP that is, in mysql itself it is possible.
You will have to run 2 query's and combine them in PHP.
Greetz Daan
query two databases
Moderators: egami, macek, gesf
DoppyNL wrote:You can't.
I PHP that is, in mysql itself it is possible.
You will have to run 2 query's and combine them in PHP.
Greetz Daan
I think you got it the other way around ;) In MySQL you can't, but in PHP you can. Run two separate queries and use PHP to combine and extract the data
Sorry, but I got it right,
you can do this in the command line of mysql:
and will return the result. as if it where 2 tables in the same database.
PHP can't do this because the query function wants a database-connection wich has selected one database. So PHPmyAdmin can't do this either...
Greetz Daan
you can do this in the command line of mysql:
Code: Select all
select field1, field2 from database1.table1, database2.table2;
and will return the result. as if it where 2 tables in the same database.
PHP can't do this because the query function wants a database-connection wich has selected one database. So PHPmyAdmin can't do this either...
Greetz Daan
Hmm, I see! Yes, I have seen that before! And, if I'm not mistaken, PHP can also do it then through access to the one database if the permissions are the same. I will have to give it another test, 'cos I remember doing something a while back!