I am writing a PHP script in which I need to query 1 table in one database, and one table in another MySQL db. I dont know how I should write the connect statement.
then, as you need to query one databse or the other, you just use the correct connection
$res=mysql_exec($conn,"select * from table;"
if selecting in 1st DB
or
$res=mysql_exec($conn2,"select * from table;"
if selecting in 2nd DB Khaldryck
Programmer at the University of Brussel (Belgium)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.