I am trying to build a project that can use a MYSQL Database OR a MSSQL Database. Production server can have ONLY MSSQL or MySQL. NOT BOTH
running the project with:
localhost/mydir/output/login.php?datadb=MS
or
localhost/mydir/output/login.php?datadb=MY
inserting this code in Server Database Connection (called DoubleConn):
if ($_GET["datadb"]=='MS'){
$host="PC-DOM\\SQLEXPRESS";
$dbname="dbaseone";
$options="SSPI";
$ODBCString = "Provider=SQLNCLI10;Server=PC-DOM\\SQLEXPRESS;Database=dbaseone;Integrated Security=SSPI";
}else{
$host="localhost";
$user="root";
$pwd="";
$port="";
$sys_dbname="dbaseone";
}
the procedure SHOULD select one db or the other, but it is working only with datadb=MY (with datadb=MS I have this error:
Fatal error: php_network_getaddresses: getaddrinfo failed: Host sconosciuto. in C:\webapp\dbmail\output\connections\MySQLiConnection.php on line 84
If I build the project with ONLY MySql Connection or ONLY MSSQL Connection everything it is working fine (Single Connections are OK).
Any Idea?
Thank you to everybody .....
Domenico