odbc_num_rows is not implemented by some "high performance" SQL-servers. The reason for this is that these servers return rows of the resultset before all rows from the result are identified. This means that the number of rows in the resultset is not known before all the rows are fetched.
Two ways that can help you out are
(1) using an extra query that goes like "SELECT COUNT() FROM..." to know the number of rows in the resultset before you start fetching from the query "SELECT FROM..."
(2) using a counter while fetching the rows, so you know after fetching all the rows the number of rows in the resultset. The code is like this
$count_rows = 0;
while (odbc_fetch_row($result)) {
print odbc_result($result, 1);
$count_rows++;
}
now you can use $count_rows, albeit that the value is [0,1+] and not [-1,0,1+]