Posts Tagged "MSSQL"

Connect to remote MSSQL database via PHP

Posted on May 4, 2012 in PHP & MSSQL Examples

<?php $RemoteServer = mssql_connect ( ‘ip:port’, ‘username’, ‘password’ ) or die ( ‘Cannot connect to server’ ); $Query = ‘SELECT * FROM [dbname].[dbo].[dbtable] ‘; $GetResult = mssql_query ( $RemoteServer, $Query ) or die ( ‘Query Error!’ ); while ( $Result = mssql_fetch_array ( $GetResult ) )  { //var_dump($Result); print ‘Result = ‘.$Result[‘TableColumnName’]; } ?>

Read More