Home > Backend Development > PHP Tutorial > 请问php连接mssql2000的有关问题

请问php连接mssql2000的有关问题

WBOY
Release: 2016-06-13 10:00:32
Original
783 people have browsed it

请教php连接mssql2000的问题!
$connect   =   mssql_pconnect( " ", "sa ", "haha ");
  mssql_select_db( "UserInfo ",$connect);

  $query   =   "select   *   from   UserInfo ";
  $result   =   mssql_query($query);
  $rows   =   @mssql_num_rows($result);
 

  for($i=0;   $i   @mssql_data_seek($result,$i);
  $data   =   @mssql_fetch_array($result);
echo   "$data[id]   $data[username]   $data[name] ";
       
  }
 
  mssql_close($connect);


代码如上,使用sql验证模式无法显示数据!
如果把第一行注释掉,代码能正常运,我猜是php是利用mssql2000的windows登录模式连接的,但实际应用中,应该是用sql验证模式连接的吧。
请有这方面的经验的朋友帮帮忙!

------解决方案--------------------
修改MSSQL Server的认证方式,同时支持Windows认证和SQL SERVER认证就可以
了,可以使用企业管理器修改
------解决方案--------------------
主机地址的问题吧?填入127.0.0.1试试?

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template