


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

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



PHPWarning:Invalidargumentsuppliedforforeach()-Solution When developing web pages or applications using PHP, you often encounter various errors and warnings. One of the common warnings is "Invalidargumentsuppliedforforeach()", which is usually produced when using a foreach loop to iterate over an array. This question seems simple, but if you don't

How to solve PHPWarning:fopen():SSLoperationfailedinfile.phponlineX In PHP programming, we often use the fopen function to open files or URLs and perform related operations. However, when using the fopen function, sometimes you will encounter something similar to Warning:fopen():SSLoperationfailedinfile.p

How to solve PHPWarning:file_get_contents():failedtoopenstream:HTTPrequestfailed During PHP development, we often encounter situations where HTTP requests are initiated to remote servers through the file_get_contents function. However, sometimes we encounter a common error message: PHPWarning: file_get_c

In this article, we will show you how to reorder multiple columns in PowerQuery by dragging and dropping. Often, when importing data from various sources, columns may not be in the desired order. Reordering columns not only allows you to arrange them in a logical order that suits your analysis or reporting needs, it also improves the readability of your data and speeds up tasks such as filtering, sorting, and performing calculations. How to rearrange multiple columns in Excel? There are many ways to rearrange columns in Excel. You can simply select the column header and drag it to the desired location. However, this approach can become cumbersome when dealing with large tables with many columns. To rearrange columns more efficiently, you can use the enhanced query editor. Enhancing the query

In recent years, PHP has become one of the important tools for web development. However, PHP will also appear some error messages, one of the common errors is the "Invalidargumentsuppliedforforeach()" error. Here's how to fix this error. First, let’s understand what this error is. This error usually occurs when using foreach loop code, but providing invalid parameters to the loop code. In most cases, this error will crash the program

ReactQuery database plug-in: Methods to implement data import and export, specific code examples are required. With the widespread application of ReactQuery in front-end development, more and more developers are beginning to use it to manage data. In actual development, we often need to export data to local files or import data from local files into the database. In order to implement these functions more conveniently, you can use the ReactQuery database plug-in. The ReactQuery database plugin provides a series of methods

As a widely used programming language, PHP is widely used in many fields such as web development and server-side programming. During development, you may encounter the following error message: PHPWarning:strtolower()expectsparameter1tobestring. The solution to this problem lies in understanding the usage and parameters of the strtolower() function. First of all, strtolower() is a PHP built-in function used to convert

In PHP programming, Warning messages often appear. One of the more common prompts is "PHPWarning:implode():Invalidargumentspassed". This article will introduce the ideas and methods to solve this Warning. First, we need to understand how to use the implode() function. The function of this function is to concatenate an array into a string, using the following syntax: string
