Re: DB_DataObject fetch() and delete() failure
| From: | Michael McCarthy | Date: | Tue, 20 May 2003 10:36:56 +0000 |
| Subject: | Re: DB_DataObject fetch() and delete() failure | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-5453@lists.php.net to get a copy of this message | ||
Hi Alan,
Sorry it has taken me so long to respond... and thanks for your help.
> > The error I get is: "Fatal error: Call to a member function on a
non-object
> > in DB/DataObject.php on line 382".
> >
> > Is it no longer possible to delete within a fetch loop? Ie.
> >
> > while ($sc->fetch()) {
> > $sc->delete();
> > }
>
> that should work. can you file it as a bug report.
Done.
> can you install the current cvs version and let me know the
> the line number that is failing in there.
>
> BTW what does DB_DataObject::debugLevel(1) tell you?
I installed the current CVS version this morning. debugLevel(1) gives:
*--*
__find
sql QUERYSELECT * FROM sub_categories WHERE sub_categories.ca_id = 33
query DONE QUERY
__find CHECK autofetchd
__find DONE
fetchrow sub_categories DONE
sql QUERYDELETE FROM sub_categories WHERE sub_categories.id = 132
query DONE QUERY
Fatal error: Call to a member function on a non-object in
pear/lib/php/DB/DataObject.php on line 385
*--*
There were three sub_categories in the database that should have been
deleted (as well as the top level category). However, the fetch() loop only
gets executed once before the fatal error. Two sub_categories and their
parent category remain.
Kind regards,
Michael McCarthy