i need help please

By m.akkad ·
I'm writing the following piece of code to get some information from an SQL Server database....
$myServer = "server_name";
$myUser = "user_name";
$myPass = "password";
$myDB = "dbname";

//connection to the database
$dbhandle = mssql_connect($myServer, $myUser, $myPass)
or die("Couldn't connect to SQL Server on $myServer");

//select a database to work with
$selected = mssql_select_db($myDB, $dbhandle)
or die("Couldn't open database $myDB");

//declare the SQL statement that will query the database
$query = "select * ";
$query .= "FROM table ";
$query .= "WHERE some_conditions";

//execute the SQL query and return records
$result = mssql_query($query);

$numRows = mssql_num_rows($result);
echo "<h1>" . $numRows . " Row" . ($numRows == 1 ? "" : "s") . " Returned </h1>";

//close the connection

but when i try to preform this page i get the following error...

Fatal error: Call to undefined function mssql_connect() in C:\AppServ\www\conn.php on line 8

can anyone suggest a solution for this error....

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Answers

Related Discussions

Related Forums