Easysoft Data Access

Why does SQLRowCount/odbc_num_rows and $sth->rows return -1?

Article:
00939
Last Reviewed:
2nd January 2024
Revision:
9

odbc_num_rows is the PHP wrapper for the ODBC API SQLRowCount. $sth->rows is the Perl DBI method of obtaining the results from the ODBC API SQLRowCount.

Most ODBC drivers only return a meaningful number from SQLRowCount call when you execute row changing SQL e.g. UPDATES, DELETES, INSERTS. For SELECTS most ODBC drivers return -1.

Applies To

Knowledge Base Feedback

* Did this content help you?
* Please select one option based on your first choice:

(* Required Fields)