note 123520 added to function.odbc-num-rows
| From: | tom dot underwood5 at gmail dot com | Date: | Tue, 15 Jan 2019 13:56:35 +0000 |
| Subject: | note 123520 added to function.odbc-num-rows | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-210064@lists.php.net to get a copy of this message | ||
sometimes if you are for example using a stored procedure rather than an actual
SELECT/INSERT/UPDATE, the odbc_num_rows can return unrealiable numbers (I was getting 3 or 0 for
everything). In my case I was able to determine the number of rows with the following:
// Put the data in array
while ($data[] = odbc_fetch_array($result));
// use native php function to get its size
$num_rows = count($data);
echo $num_rows;
Hope this helps someone.
----
Server IP: 208.43.231.9
Probable Submitter: 185.85.3.194 (proxied: 62.105.174.181)
----
Manual Page -- http://php.net/manual/en/function.odbc-num-rows.php
Edit -- https://master.php.net/note/edit/123520
Del: integrated -- https://master.php.net/note/delete/123520/integrated
Del: useless -- https://master.php.net/note/delete/123520/useless
Del: bad code -- https://master.php.net/note/delete/123520/bad+code
Del: spam -- https://master.php.net/note/delete/123520/spam
Del: non-english -- https://master.php.net/note/delete/123520/non-english
Del: in docs -- https://master.php.net/note/delete/123520/in+docs
Del: other reasons-- https://master.php.net/note/delete/123520
Reject -- https://master.php.net/note/reject/123520
Search -- https://master.php.net/manage/user-notes.php