note 97965 added to function.odbc-num-rows

From: Date: Tue, 18 May 2010 21:44:35 +0000
Subject: note 97965 added to function.odbc-num-rows
Groups: php.notes 
Request: Send a blank email to php-notes+get-169378@lists.php.net to get a copy of this message
None of these examples were working for me, so I came up with the following silly procedure that gives me the number of rows. This example is crude, but you should get the idea. <?php $cxn = odbc_connect("ODBC_DSN_NAME", "", ""); $sql = "SELECT * FROM some_table'"; $res = odbc_exec($cxn, $sql); $items = 0; while ($row = odbc_fetch_array($res)) { $items++; } odbc_free_result($res); echo "<br>total No. of rows: $items"; ?> ---- Server IP: 192.41.40.227 Probable Submitter: 65.44.177.66 ---- Manual Page -- http://www.php.net/manual/en/function.odbc-num-rows.php Edit -- https://master.php.net/note/edit/97965 Del: integrated -- https://master.php.net/note/delete/97965/integrated Del: useless -- https://master.php.net/note/delete/97965/useless Del: bad code -- https://master.php.net/note/delete/97965/bad+code Del: spam -- https://master.php.net/note/delete/97965/spam Del: non-english -- https://master.php.net/note/delete/97965/non-english Del: in docs -- https://master.php.net/note/delete/97965/in+docs Del: other reasons-- https://master.php.net/note/delete/97965 Reject -- https://master.php.net/note/reject/97965 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#169378) next »