note 98836 added to function.odbc-num-rows
| From: | walt at brookhouse dot co dot uk | Date: | Fri, 09 Jul 2010 21:45:05 +0000 |
| Subject: | note 98836 added to function.odbc-num-rows | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-170852@lists.php.net to get a copy of this message | ||
The easy way to count the rows in an odbc resultset where the driver returns -1 is to let SQL do the
work:
<?php
$conn = odbc_connect("dsn", "", "");
$rs = odbc_exec($conn, "SELECT Count(*) AS counter FROM tablename WHERE
fieldname='" . $value . "'");
$arr = odbc_fetch_array($rs);
echo $arr['counter'];
?>
----
Server IP: 69.147.83.197
Probable Submitter: 81.137.237.103
----
Manual Page -- http://www.php.net/manual/en/function.odbc-num-rows.php
Edit -- https://master.php.net/note/edit/98836
Del: integrated -- https://master.php.net/note/delete/98836/integrated
Del: useless -- https://master.php.net/note/delete/98836/useless
Del: bad code -- https://master.php.net/note/delete/98836/bad+code
Del: spam -- https://master.php.net/note/delete/98836/spam
Del: non-english -- https://master.php.net/note/delete/98836/non-english
Del: in docs -- https://master.php.net/note/delete/98836/in+docs
Del: other reasons-- https://master.php.net/note/delete/98836
Reject -- https://master.php.net/note/reject/98836
Search -- https://master.php.net/manage/user-notes.php