odbc_num_rows does return -1 when it shouldn't.
i used this code:
<?php
if( odbc_num_rows( $Result ) ) {
while( false !== ( $Row = @odbc_fetch_array( $Result ) ) ) {
}
}
else {
return false;
}
?>
and it didn't work... obviously
but this while loop will skip an empty result set anyway, so i use this:
<?php
while( false !== ( $Row = @odbc_fetch_array( $Result ) ) ) {
}
if( ! odbc_num_rows( $Result ) ) {
return false;
}
?>
because after processing the $Result with fetch, odbc_num_rows reports the correct count (false|0..n) ... magic :-)