Calling odbc_fetch_array after executing a stored procedure in PHP gives error [Microsoft][ODBC SQL Server Driver]Invalid Descriptor Index

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-01 09:13:33
cwill747

I ran into this problem as well. The way I got around it was to use

odbc_exec($connection, $sql)

Instead of

odbc_execute($connection, $sql)

Per a user comment here

Comment was:

BTW. If anyone is banging his head about "cursor type changed" warning while using execute with ORDER BY clause, then just use exec for now (remember to addslashes for yourself).

In PHP 5.3 a Bug #43668 will be fixed and it will allow you to change a cursor type to SQL_CUR_USE_ODBC

Note that you could also try to select a cursor type in odbc_connect, but that didn't work for me (much more problems appeared then it solved).

Apparently this is a bug in PHP, and will be patched per this

So try using odbc_exec() insted of odbc_execute() if you are having this problem.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!