【发布时间】:2017-12-30 13:08:34
【问题描述】:
我在 Linux 服务器上托管了我的网站,我想连接 MS SQL 数据库。我在编程中使用过 PHP。我已经联系了这两家服务器提供商,他们在一定程度上提供了帮助。但是我的问题没有解决,你能指导我做什么吗?我的代码如下。
当我运行它时,它显示“找不到驱动程序1”
请指导我。提前致谢
<?php
//echo phpinfo();
?>
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<h1>testing</h1>
</body>
</html>
<?php
// Server in the this format: <computer>\<instance name> or
// <server>,<port> when using a non default port number
$server = 'server:port';
$myDB = "DatabaseName";
// Connect to MSSQL
$link = mssql_connect($server, 'username', 'password');
if (!$link) {
die('Something went wrong while connecting to MSSQL');
}
else
{
echo "success";
}
?>
【问题讨论】:
标签: php sql-server linux database database-connection