开发者

Want to connect PHP5 to MS SQL SERVER 2005 in linux

开发者 https://www.devze.com 2023-04-08 16:06 出处:网络
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

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

0

精彩评论

暂无评论...
验证码 换一张
取 消