I'm using PHP 4.2 on a Windows box and am having trouble with getting
an ODBC record count. The code I have returns the correct record
count only once. It seems like the cursor is not going back to the
beginning but i'm not sure. Here is the code that I'm using:
function odbc_record_count($sql_id, $CurrRow = 1)
{
if ($NumRecords=odbc_num_rows($sql_id)<0) {
$NumRecords = 0;
odbc_fetch_row($sql_id,0);
while (odbc_fetch_row($sql_id))
{
$NumRecords++;
}
odbc_fetch_row($sql_id, $CurrRow);
}
return $NumRecords;
}
Any help is appreciated!
Thanks,
Howie