note 64086 added to function.odbc-num-rows

From: Date: Fri, 07 Apr 2006 07:28:11 +0000
Subject: note 64086 added to function.odbc-num-rows
Groups: php.notes 
Request: Send a blank email to php-notes+get-107493@lists.php.net to get a copy of this message
If you simply want to loop through the results of a query if there are some results a more efficient way to do it (without looping once for the count and another time for doing whatever you want to do ..) would be this: $result2 = odbc_exec($vConn, $vSql); if (odbc_fetch_row($result2, 1)) { //Some results odbc_fetch_row($result2, 0); //Go back to 1st row while ($vField = odbc_fetch_array($result2)) { .... } } I hope this helps. ---- Server IP: 193.95.141.37 Probable Submitter: 83.71.143.5 (proxied: 192.168.122.160) ---- X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER autolearn=no version=2.64 ---- Manual Page -- http://www.php.net/manual/en/function.odbc-num-rows.php Edit -- http://master.php.net/note/edit/64086 Del: integrated -- http://master.php.net/note/delete/64086/integrated Del: useless -- http://master.php.net/note/delete/64086/useless Del: bad code -- http://master.php.net/note/delete/64086/bad+code Del: spam -- http://master.php.net/note/delete/64086/spam Del: non-english -- http://master.php.net/note/delete/64086/non-english Del: in docs -- http://master.php.net/note/delete/64086/in+docs Del: other reasons-- http://master.php.net/note/delete/64086 Reject -- http://master.php.net/note/reject/64086 Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#107493) next »