Skip to content
Advertisement

Mssql fetch array show error in while loop

I’m write a query for take some result in mssql server ,that working but now they some errors ,the error is

Warning: mssql_fetch_array(): 3 is not a valid MS SQL-result resource in

my connection query is working and there is no problem, my query like this

JavaScript

var_dump the $result show

resource(3) of type (mssql result)

the query is execute in sql-server whyshow this type error any way to solve this issue please help me?

Advertisement

Answer

One possible explanation is the return value from mssql_query():

Return Values

Returns a MS SQL result resource on success, TRUE if no rows were returned, or FALSE on error.

It’s important to check the result from mssql_query():

JavaScript

Notes:

MSSQL extension was removed in PHP 7.0. One good option is PHP Driver for SQL Server.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement