[SQLSTATE] 24000 [Error] Invalid cursor state [Description] 
A cursor was open on the StatementHandle, and SQLFetch or SQLFetchScroll had been called. This error is returned by the Driver Manager if SQLFetch or SQLFetchScroll has not returned SQL_NO_DATA and is returned by the driver if SQLFetch or SQLFetchScroll has returned SQL_NO_DATA. A cursor was open on the StatementHandle, but SQLFetch or SQLFetchScroll had not been called.