we are trying to create a connection with our SQL database trough ODBC in PHP.
This is our current script:
$cnx = new PDO(\"odbc:Driver={EFR};Serve
try adding DSN on System instead of user
if you already have the ODBC defined and have a stored password, you can simply connect with
$conn = new PDO("odbc:DSN_NAME")
where DSN_NAME is the actual name of your ODBC datasource, be it MySQL, SQL Server or DB2.
You can test your connection with the following:
try{
$conn = new PDO ("odbc:DSN_NAME");
die(json_encode(array('outcome' => true)));
}
catch(PDOException $ex){
die(json_encode(array('outcome' => false, 'message' => 'Unable to connect')));
}