One of the SELECT fails using unixOdbc - SQLSTATE[24000]: Invalid cursor state

[亡魂溺海] 提交于 2019-12-05 08:11:49

It looks you have two different result sets open at the same time. You have to finish processing your first ResultSet and close it so you can re-use the Statement to create the second ResultSet.

Here is the practical implementation of @mihai-bejenariu answer.

If you are using PHP and PDO, you can do like this:

$query = "<your sql query>";
$sth = $connection->prepare($query);
$sth->execute();
$result = $sth->fetchAll();
$sth->closeCursor();   //Write this after you have fetched the result
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!