I have this code which I use in order to connect to SQL Server.
$host="";
$uid="sa";
$passVal="";
odbc_connect("Driver={SQL Server};Server=$host;",$uid, $passVal);
How should I check the connection?
I mean what should I put in my code? like:
If connection was set then output “connected” else “disconnected”
And, how can I select the database here?
Should it be something like:
$database="";
odbc_connect("Driver={SQL Server};Server=$host;",$uid, $passVal, $database);
For you reference http://php.net/manual/en/function.odbc-connect.php