Warning: mssql_query () [function. mssql-query]: Queryfailedinsql can be correctly executed in the database, but the following error occurs when php is used: Warning: & nbsp; mssql_query () & nbsp; [function. mssql-query]: & nbsp; Query & nbsp; failed & nbsp; in... wa Warning: mssql_query () [function. mssql-query]: Query failed in
SQL can be correctly executed in the database, but an error is returned when php is used:
Warning: mssql_query () [function. mssql-query]: Query failed in...
Warning: mssql_fetch_array (): supplied argument is not a valid ms SQL-result resource in...
The error line is as follows:
$ Query = mssql_query ($ SQL );
While ($ row = mssql_fetch_array ($ query )){
The SQL statement will not be pasted out for a long time, but it is absolutely correct. After I output the SQL statement using echo, it will be correctly executed in the database. How can I solve the above problems?
------ Solution --------------------
Warning: mssql_query () [function. mssql-query]: Query failed in...
Query failed!
------ Solution --------------------
How can I know it is correct?
------ Solution --------------------
If the SQL statement is correct, the wrong database may be selected.
Besides, what you see is not necessarily the truth.
------ Solution --------------------
I also encountered this problem.