Fatal error: Call to undefined function: mssql_connect() in C:\Inetpub\wwwroot\database.php on line 5该如何解决呢?

carylw 2003-08-21 01:39:10
我的程序是:
<?php
function mssql_count()
{
php_mssql.dll;
$conn = mssql_connect("cary", "liwei", "210124810623");

mssql_select_db(test);
$sql = "select*from table_count";
$result = mssql_query($sql,$conn);
$count = mssql_result($result,0,"count_my");
$sql = "update table_count set count_my = \".($count+1).\"where id = 1";
mssql_query($sql,$conn);
mssql_close($conn);
$count_update = $count+1;
return $count_update;

}
echo mssql_count();
?>
当我浏览时却出现:
Fatal error: Call to undefined function: mssql_connect() in C:\Inetpub\wwwroot\database.php on line 5
而在我的php.ini中没有mssql_connect这个,是不是所有的都没有mssql_connect呢,我该怎么做呢?
...全文
862 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
tigerhzy 2003-12-30
  • 打赏
  • 举报
回复
请确定:你只一个配置正确的php.ini

要么只有php4/php.ini,要么只有winnt/php.ini!
arcow 2003-08-26
  • 打赏
  • 举报
回复
帮你顶
carylw 2003-08-26
  • 打赏
  • 举报
回复
本来是dl('php_mssql.dll),但是在浏览时却出现:
Warning: dl(): Not supported in multithreaded Web servers - use extension statements in your php.ini in C:\Inetpub\wwwroot\database.php on line 4
当我把dl('')去掉后就没有这个错误了。
服务器启动时没有出现错误。
xuzuning 2003-08-25
  • 打赏
  • 举报
回复
1、function mssql_count()
{
php_mssql.dll; // 要这行干什么?
$conn = mssql_connect("cary", "liwei", "210124810623");

2、至少安装sql server客户端
3、去掉php.ini中extension=php_mssql.dll前的分号
4、观察web服务启动时的报错情况
carylw 2003-08-25
  • 打赏
  • 举报
回复
早就去掉了,不好用的。就是没有mssql_connect.
luxuezhu 2003-08-25
  • 打赏
  • 举报
回复
mark
bonniewater 2003-08-23
  • 打赏
  • 举报
回复
你不用加,但是你去掉前面的分号了吗?
carylw 2003-08-23
  • 打赏
  • 举报
回复
我的php.ini中有extension=php_mssql.dll,根本不用加的,你所说的也没有找到,不知道到底是怎么做的?

westdo 2003-08-21
  • 打赏
  • 举报
回复
The MSSQL extension is enabled by adding extension=php_mssql.dll to php.ini.

To get these functions to work, you have to compile PHP with --with-mssql[=DIR], where DIR is the FreeTDS install prefix. And FreeTDS should be compiled using --enable-msdblib.

21,886

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧