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

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

Most ODBC drivers only return a meaningful number from SQLRowCount call if you execute row changing SQL. For example, UPDATES, DELETES, and INSERTS. For SELECT statements, most ODBC drivers return -1.