RE: [PEAR] Oracle and numRows
| From: | Dimoff, Steve | Date: | Tue, 16 Dec 2003 13:07:17 +0000 |
| Subject: | RE: [PEAR] Oracle and numRows | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-9561@lists.php.net to get a copy of this message | ||
Should the variable be $this or something else?
Thanks,
Steve
-----Original Message-----
From: Lukas Smith [mailto:smith@backendmedia.com]
Sent: Monday, December 15, 2003 3:41 PM
To: 'Dimoff, Steve'; pear-general@lists.php.net
Subject: RE: [PEAR] Oracle and numRows
> From: Dimoff, Steve [mailto:sdimoff@accipiter.com]
> Sent: Monday, December 15, 2003 9:31 PM
> I'm trying to get the numRows command to work with using
> Oracle.
> Here is my code:
>
> $dsn = "somebox://me@here";
> $db = DB::connect($dsn);
> if (DB::isError($db)) {
> die ($db->getMessage());}
>
> $sql = "select RUR_ID, EMAIL, GENDER, AGE, P_CODE, P_TOWN from
> AD_SRV_LIBRARY where $urField like '%$urValue' order by $SortBy";
> $result = $db->query($sql);
>
> if (DB::isError($result)) {
> die ($result->getMessage());
> }
>
> echo "\n[" . $result->numRows(). " rows returned]\n";
>
> ---- END OF COPY/PASTE
>
> The information I get back is "Object" every time. Anyone know why?
You need to set your options accordingly:
$this->options['optimize'] == 'portability'
Whenever you are getting objects where you expect something else it will
probably be an error object. I recommend you take a look at how the pear
error handling works.
Here is a link to get you started:
http://www.php-mag.net/itr/online_artikel/psecom,id,330,nodeid,114.html
Regards,
Lukas
--
PEAR General Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php