odbc_fetch_array returns Invalid Cursor Position

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
rwurzer
Forum Newbie
Posts: 2
Joined: Wed Jan 16, 2008 5:43 pm

odbc_fetch_array returns Invalid Cursor Position

Post by rwurzer »

I have Sql Server 2005 php 5.2.5. My query does a left join and some fields return NULL. On every row that has a null value odbc_fetch_array() sends the message

Warning: odbc_fetch_array() [function.odbc-fetch-array]: SQL error: [Microsoft][ODBC SQL Server Driver]Invalid cursor position, SQL state S1109 in SQLGetData in C:\Work\NACCC\SourceControl\wwwroot\NASecure\membership\cftsappfin.php on line

The query does return the expected number of rows, but every row that contains a NULL kicks out this error.

I've looked at the values in the row, and they are all null or empty.

Querying the database in SQL Enterprise works fine.

This same code seems to be working in php 4.3.4 with Sql Server 2000. Is there some setting I'm missing?

Thanks in advance for any help.

Ron
rwurzer
Forum Newbie
Posts: 2
Joined: Wed Jan 16, 2008 5:43 pm

Re: odbc_fetch_array returns Invalid Cursor Position

Post by rwurzer »

I found it. I was using an old version of Microsoft SQL Server ODBC driver. I updated and that solved the problem.
Post Reply