Quantcast
Channel: Microsoft SQL Server
Viewing all articles
Browse latest Browse all 4871

PHP and MSSQL - cannot make a connection to server

$
0
0

Greetings All

WE are trying to display data on a webpage pulled from an SQL server through PHP code however we just cannot get it to work. We have checked, rechecked, downloaded the drivers (twice), checked the file paths, googled and just can't get it to work. Any hints?

TIA

PHP 5.6 and using Xampp

Code and errors below


Code:

mssql conection :

$myServer = "MYSERVER";
$myUser = "User";
$myPass = "pass";
$myDB = "Teraoka_Avg_Weight";

//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");

Error:

error: Call to undefined function mssql_connect() in C:\...


Viewing all articles
Browse latest Browse all 4871

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>