I would like to know how to get the number of rows returned by by an odbc connection. Unfortunately I get a -1 for the following code.
<?
$db = odbc_connect("NN.dsn","tj","bismillah",SQL_CUR_USE_ODBC);
$query = "select * from users";
$result = odbc_exec($db,$query);
$num_rows = odbc_num_rows($result);
echo "No of records...".$num_rows."<br>";
while (odbc_fetch_row($result)) {
$realname = odbc_result($result,"realname");
echo $realname."<br>";
}
odbc_close($db);
?>