Home  >  Article  >  Backend Development  >  Warning: mssql_query() [function.mssql-query]: Query failed in,该如何处理

Warning: mssql_query() [function.mssql-query]: Query failed in,该如何处理

WBOY
WBOYOriginal
2016-06-13 11:58:541308browse

Warning: mssql_query() [function.mssql-query]: Query failed in
sql在数据库中能正确执行,但用php执行报错:
Warning: mssql_query() [function.mssql-query]: Query failed in...
Warning: mssql_fetch_array(): supplied argument is not a valid MS SQL-result resource in...
错误出现的行如下:

$query = mssql_query($sql);<br />while($row=mssql_fetch_array($query)){


sql很长就不贴出了,但sql绝对是正确的,我用echo输出sql后在数据库中正确执行。 请问大神该怎么解决上面的问题
------解决方案--------------------
Warning: mssql_query() [function.mssql-query]: Query failed in...
查询失败!
------解决方案--------------------
我怎么能知道是正确的呢?
------解决方案--------------------
SQL如果是正确的,可能是选错库了。
再说,你看到的不一定是真相,所以别说一定怎么样。
------解决方案--------------------
我也遇到这个问题

Statement:
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