Jump to content

php 5 server connecting to a 2000 server with a sql database


veedub

Recommended Posts

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 */

}

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.