worldcomingtoanend Posted March 24, 2009 Share Posted March 24, 2009 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; Link to comment https://forums.phpfreaks.com/topic/150857-whats-wrong-with-this-code-echo-row-number-error-of-0-instead-of-1/ Share on other sites More sharing options...
Mchl Posted March 24, 2009 Share Posted March 24, 2009 Did you change ODBC driver meanwhile? Link to comment https://forums.phpfreaks.com/topic/150857-whats-wrong-with-this-code-echo-row-number-error-of-0-instead-of-1/#findComment-792459 Share on other sites More sharing options...
worldcomingtoanend Posted March 24, 2009 Author Share Posted March 24, 2009 Did you change ODBC driver meanwhile? I definitely did not change anything. Link to comment https://forums.phpfreaks.com/topic/150857-whats-wrong-with-this-code-echo-row-number-error-of-0-instead-of-1/#findComment-792460 Share on other sites More sharing options...
Mchl Posted March 24, 2009 Share Posted March 24, 2009 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. Link to comment https://forums.phpfreaks.com/topic/150857-whats-wrong-with-this-code-echo-row-number-error-of-0-instead-of-1/#findComment-792466 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.