Re: numRows() trouble....
| From: | Dave Morris | Date: | Mon, 03 Feb 2003 21:35:27 +0000 |
| Subject: | Re: numRows() trouble.... | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-3591@lists.php.net to get a copy of this message | ||
Hey Cory,
Not sure if this will do anything, but here goes. Try
$result = $db_obj->query($query);
instead. usually when I get that error it is because my mysql statement
is faulty. however "SELECT * FROM users" seems pretty straightforward
given that 'users' exists. Hope this helps.
-dave
On Mon, 3 Feb 2003, Cory Hicks wrote:
> Hello again....
>
> Thanks to the list for the recent help! I am now moving onto other cool
> PEAR features, but seem to be having problems with numRows(). I keep
> getting this error:
>
> Fatal error: Call to a member function on a non-object
>
> Here is the code:
>
> $query="SELECT * FROM users";
>
> $result=$db_obj->simpleQuery($query);
>
> if (DB::isError($result))
> die($result->getMessage());
>
> $num = $result->numRows();
>
> What I am missing?
>
> Thanks,
>
> Cory
>
>
> --
> Cory Hicks <chicks@tri-intl.com>
> TRI-International
>
>
> --
> PEAR General Mailing List (http://pear.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>