please assist.
i can not connect to my sql server (172.16.15.119).
i always get this message"Fatal error: Call to undefined function sqlsrv_connect() in C:\Program Files (x86)\EasyPHP-12.1\www\malunde\connect.php on line 5"

and the code that i used is:

<?php
$serverName = "172.16.15.119"; //serverName\instanceName
$connectionInfo = array( "Database"=>"TPA-CS_UAT", "UID"=>"sa", "PWD"=>"tpa123");
$conn = sqlsrv_connect( $serverName, $connectionInfo);

if( $conn ) {
     echo "Connection established.<br />";
}else{
     echo "Connection could not be established.<br />";
     die( print_r( sqlsrv_errors(), true));
}

what is wrong with this code?

Recommended Answers

All 3 Replies

undefined function sqlsrv_connect() a clue maybe?

i don get you!what do you mean by a clue maybe?

I'll do a bit of guessing here since I do not have experience with MS SQL server. It seems that MS SQL support is not installed in your EasyPHP environment (default is mySql). There is some info on this link on how to do it.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.