mardi 12 juillet 2016

mysql_select_db ODBC equivalent

I'm looking for an ODBC equivalent of the following in PHP:

$handle_db1 = mysql_connect("localhost","myuser","apasswd");
$handle_db2 = mysql_connect("127.0.0.1","myuser","apasswd");
mysql_select_db("db1",$firstDB);
mysql_select_db("db2",$SecondDB);
//get the results when there is a match
$query_match="SELECT * FROM SecondDB.TableA inner join firstDB.TableA  ON TableA.userID=TableB.userID";
//get the results when there is no match
$query_nomatch="SELECT * FROM SecondDB.TableA outer join firstDB.TableA  ON TableA.userID=TableB.userID";

The reason being one of the databases is MYSQL whilst the other is an old Progress DB. Would anyone have an idea how I would do this? Cheers

Aucun commentaire:

Enregistrer un commentaire