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

Source: Internet
Author: User
SQL executes correctly in the database, but uses PHP to perform the error:
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 line where the error occurred is as follows:
$query = Mssql_query ($sql); while ($row =mssql_fetch_array ($query)) {


SQL is not posted for a long time, but SQL is absolutely correct, I use echo to output SQL and execute correctly in the database. How can the great God solve the problem above


Reply to discussion (solution)

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

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


But SQL is right and I'm sure it's right. Why does the query fail?

How am I supposed to know it's right?

If SQL is correct, it may be the wrong library.
Besides, what you see is not necessarily the truth, so don't say how it must be.

I have this problem, too.

I have this problem, too.


You try to write SQL in other equivalent form, such as = ' xx ' instead of In (' xx ')
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.