如何将sql连接到php
我已将 sql 连接到 php 但显示错误
调用未定义的函数mssql_connect()
<?php
$myServer = "sql";
$myUser = "ste";
$myPass = "the";
$myDB = "SQL2005";
$dbhandle = mssql_connect($myServer, $myUser, $myPass)
or die("Couldn't connect to SQL Server on $myServer");
?>
I had connect sql to php but it shows error
Call to undefined function mssql_connect()
<?php
$myServer = "sql";
$myUser = "ste";
$myPass = "the";
$myDB = "SQL2005";
$dbhandle = mssql_connect($myServer, $myUser, $myPass)
or die("Couldn't connect to SQL Server on $myServer");
?>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
根据 文档,您尝试使用的 MS SQL 扩展不再是支持,您应该使用替代方案。
According to the documentation, the MS SQL extension you are trying to use is no longer supported and you should use an alternative.
mssql_connect
似乎是一个拼写错误
mssql_connect
Appears to be a typo
检查您的
phpinfo()
并确保启用mssql
扩展。请参阅 PHP.netCheck your
phpinfo()
and make sure themssql
extension is enabled. See PHP.net在您的“php.ini”中,搜索
并取消注释(如果已注释)。然后检查是否可以使其工作。
in your "php.ini", search for
and uncoment if its already commented. Then check if you can get it working.
以下链接应该可以帮助您解决此问题: http://www.phpfreaks.com /forums/index.php?topic=197064.0
具体来说:
这个: http://php.net/manual/en/function.mssql-connect .php 是 mssql_connect() 的文档,也可能有所帮助。
The following link should help you to resolve this: http://www.phpfreaks.com/forums/index.php?topic=197064.0
Specifically:
This: http://php.net/manual/en/function.mssql-connect.php is the documentation for mssql_connect() also which may help.
检查一下 php_mssql.dll 文件是否存在于 wamp\php\ext 位置。
hey check whether the php_mssql.dll file is present at wamp\php\ext location or not.