Jump to content

whats wrong with this code? ---- echo row number error of 0 instead of -1


Recommended Posts

I hv the code below and it has been working very well since the echo result has been -1.  a few minutes ago i all of a sudden got an echo result of 0 and now i cant do anything. What could be the problem.  thank you.

$res = odbc_exec($db, $sql);
  $row = odbc_fetch_array($res);
  $count= odbc_num_rows($res);
    echo $count;

odbc_num_rows() is known to have 'issues' unfortunately. However I never heard of it changing its behaviour, when the driver used was not changed... Only thing I can think of is to check if your query is well formed... In fact, if it returns 0 it means that query executed fine, but the result set is empty. If it returns -1 it means an error occured during query execution.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.