I currently have this script below, but I have been told that I need to create my own connect string because mssql_connect() is not supported by PHP 5.3.0.
Code: Select all
<?php
$myServer = "COMPNAME\SQLEXPRESS";
$myUser = "dbadmin";
$myPass = "dbadmin";
$myDB = "database123";
//connection to the database
$dbhandle = mssql_connect($myServer, $myUser, $myPass)
or die("Couldn't connect to SQL Server on $myServer");
if (!$dbhandle) {
die('Something went wrong while connecting to MSSQL');
}
//select a database to work with
$selected = mssql_select_db($myDB, $dbhandle)
or die("Couldn't open database $myDB");
//close the connection
mssql_close($dbhandle);
?>Fatal error: Call to undefined function mssql_connect()
I have been advised that I need to create my own connection object and connect to MSSQL. So I need to create my own 'mssql_connect' object. Is there anybody out there that can give me assistance on how I would go about doing this... ANY HELP WOULD BE APPRECIATED!!
Cheers!!