veedub Posted June 7, 2007 Share Posted June 7, 2007 Hello, I have a server, which i can ping and is on the network, with an sql database on it which i'm trying to connect to. the server i'm initially on is an Apache with only php 5 on it. do i need to enable or install anything on the PHP 5 server to recognise the mssql functions? any help would be really appreciated. to connect to the sql database i'm using the code below: firstly the script errors saying: fatal error: call to undefined function mssql_connect()............... if (function_exists('mssql_connect')) {echo "yes";} else {echo "no";} $myServer = "10.16......"; $myUser = "********"; $myPass = "********"; $myDB = "Pod1View"; // connect $cs = mssql_connect ( '*********', '********', '********' ) or die ( 'Can not connect to server' ); // select mssql_select_db ( '[Pod1View]', $cs ) or die ( 'Can not select database' ); //query $sql = "SELECT * FROM [bRANCH]"; $r = mssql_query ( $sql, $cs ) or die ( 'Query Error' ); // loop the result while ( $row = mssql_fetch_array ( $r ) ) { /* do stuff */ } Quote Link to comment Share on other sites More sharing options...
ober Posted June 9, 2007 Share Posted June 9, 2007 You must enable the mssql library in php.ini and there are a few other configurations to do as well depending on your OS. http://www.php.net/manual/en/ref.mssql.php Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.