How can I Connect to an SQL database using a PHP script?

You can use the following code to connect to a SQL database a PHP script:


$hostname = "SQL.DOMAIN.com";
$username = "User";
$password = "Pass";
$dbName = "DatabaseNamedb";

MSSQL_CONNECT($hostname,$username,$password)

Add Feedback