Home > Backend Development > PHP Tutorial > Warning: mssql_query() [function.mssql-query]: Query failed in

Warning: mssql_query() [function.mssql-query]: Query failed in

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-23 13:55:57
Original
1164 people have browsed it

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);while($row=mssql_fetch_array($query)){
Copy after login


sql很长就不贴出了,但sql绝对是正确的,我用echo输出sql后在数据库中正确执行。 请问大神该怎么解决上面的问题


回复讨论(解决方案)

Warning: mssql_query() [function.mssql-query]: Query failed in...
查询失败!

Warning: mssql_query() [function.mssql-query]: Query failed in...
查询失败!


但是sql是正确的,我肯定是正确。为什么会查询失败?

我怎么能知道是正确的呢?

SQL如果是正确的,可能是选错库了。
再说,你看到的不一定是真相,所以别说一定怎么样。

我也遇到这个问题

我也遇到这个问题


你试试把sql用其他等价的形式写写, 比如=‘xx’ 换成 in('xx')
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