更新时间:2023-02-06 08:54:12
odbc_num_rows
seems to be reliable for INSERT, UPDATE, and DELETE queries only.
The manual says:
Using odbc_num_rows() to determine the number of rows available after a SELECT will return -1 with many drivers.
one way around this behaviour is to do a COUNT(*)
in SQL instead. See here for an example.