Rather than moving to PHP 5 with Zend Core, you can just use the
ibm_db2 extension (
http://php.net/ibm_db2). It is an open source
extension that is dedicated to DB2, and therefore does things right.
Zend Core just bundles it up nicely for you :)
odbc_num_rows() and db2_num_rows() depend on the underlying
SQLNumRows() implementation, which DB2 implements according to the CLI
/ ODBC standards:
* INSERT / UPDATE / DELETE return the number of rows affected by that
particular statement.
* SELECT returns -1 because no rows were affected -- unless you use a
scrollable cursor, in which case a lock does affect those rows until
you dismiss the cursor and therefore you do get a non-negative number
back.