I want to connect mssql server using php code on linux operating system. i want to use mssql_connect开发者_JAVA技巧() .please help me. my code is
$server='x.x.x.x\SQLEXPRESS';
$link = mssql_connect($server, 'username', 'password');
if (!$link)
{
die("Couldn't connect to SQL Server on $server. Error: " . mssql_get_last_message());
}
else
{
echo "Connected!";
}
it show error "Unable to connect to server: x.x.x.x\SQLEXPRESS"
For me, this worked under debian lenny:
apt-get install libsybdb5 freetds-common php5-sybase
/etc/init.d/apache2 restart
I found the solution here: http://docs.moodle.org/20/en/Installing_MSSQL_for_PHP
精彩评论