For Programmers: Free Programming Magazines  


Home > Archive > PHP Pear > August 2004 > AW: [PEAR] two queries on the same object (Help)









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author AW: [PEAR] two queries on the same object (Help)
Webmaster

2004-08-26, 4:00 pm

Sorry, i can not answer to the question, but why i write this is because =
of
this scentence: Ok, I suppose I understand...people aren't reading the =
full
manual.

Di you really call that a manual? Only if you are master in PHP you will
understand it probably. I am not a newbie in php, but reading and
understanding that thing is pain in the ass. It might be, that there is =
also
a language gap for me, but I have seen lots of better Manuals in my =
life.
Java for example.

Sorry again, but RTFM is no possible answer in PEAR, there I would say =
WAFRM
(Write a XXXXing readable manual).

Mirco Blitz

-----Urspr=FCngliche Nachricht-----
Von: Justin Patrin [mailto:papercrane@gmail.com]=20
Gesendet: Donnerstag, 26. August 2004 19:49
An: Yuan N Yudistira
Cc: pear-general@lists.php.net
Betreff: Re: [PEAR] two queries on the same object (Help)

On Thu, 26 Aug 2004 15:55:32 +0700, Yuan N Yudistira
<yuan@sabukhitam.net> wrote:
> Hi,..
> My name is Yuan,..
> I am new to Pear
>=20
> I get this error code :
> MESSAGE: You cannot do two queries on the same object (copy it before
> finding)
> TYPE: PEAR
> DEBUG INFO:
> CODE: -1
>=20
> What does it mean?
>=20
> Where to go to find meaning of error code lika this ?
>=20
> Thanks
>=20
> YUAN
>=20
> Ps. I use Pear on Seagull Frame work and
>=20
> here is a piece of code i am trying to do :
>=20
> // Generate select box of Client specific to entity
> $oClient =3D & new DataObjects_Client();


<generatRant>
<quote movie=3D"Zoolander" character=3D"Mugatu">
I feel like I'm taking crazy pills!
</quote>
*WHY* does nearly every DataObject question have their dataobjects
instantiated in this way?

Ok, I suppose I understand...people aren't reading the full manual.
The first page shows direct object instantiation. If you keep reading,
however, you get to:
http://pear.php.net/manual/en/packa...t.db-dataobjec=
t.f
actory.php
which shows you how to use DB_DataObject::factory(). I'll ask the
maintainers to change the intro page.
</generalRant>

The preferred method is:
$oClient =3D& DataObject::factory('client');

> if($output->isJSO !=3D 1) $oRateType->whereAdd("entity_id =3D
> $iEntityID");
> $oClient->orderBy('organization_name');
> $result =3D $oClient->find();
> if ($result > 0) {
> $aClient =3D array();
> while ($oClient->fetch()) {
> $aClient[ $oClient->client_id ] =3D
> $oClient->organization_name;
> }
> }
> $output->Client =3D SGL_Output::generateSelect($aClient);
>=20


I don't see anywhere in your code that should generate this error.
What line is it happening on? Perhaps it's on the $oRateType object?
This error means that you're using the same DataObject for two
different queries.

--=20
DB_DataObject_FormBuilder - The database at your fingertips
http://pear.php.net/package/DB_DataObject_FormBuilder

paperCrane --Justin Patrin--

--=20
PEAR General Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



____________
Virus checked by Antivirus-Profi-Paket
Version: AVK 14.0.1805 from 11.08.2004
Virus news: www.antiviruslab.com
Justin Patrin

2004-08-26, 8:57 pm

On Thu, 26 Aug 2004 21:27:18 +0200, Webmaster <webmaster@lindworm.de> wrote=
:
> Sorry, i can not answer to the question, but why i write this is because =

of
> this scentence: Ok, I suppose I understand...people aren't reading the fu=

ll
> manual.
>=20
> Di you really call that a manual? Only if you are master in PHP you will
> understand it probably. I am not a newbie in php, but reading and
> understanding that thing is pain in the ass. It might be, that there is a=

lso
> a language gap for me, but I have seen lots of better Manuals in my life.
> Java for example.


Ok, I meant Documentation. Does that make you happy?

Honestly, the answer here is WAFM. Write A XXXXing Manual. Many Open
Source developers simply don't have the time to write a full manual,
but PEAR does require source-level docs, so look at the (wonderful)
API docs links in the Documentation section. If you can't figure it
out, post to the PEAR-General list. If you want better docs, WRITE
SOMETHING. We'll be happy to post it.

IMHO, the docs for DB_DO are fine as they are. There's a nice intro
telling you what the reason for the package is, there are decent
examples, and everything is documented. What you're looking at is
End-User Documentation, a Manual. If you want more, you're really look
for a Tutorial, which lots of docs don't have. Again, if you think
there needs to be one, write one.

>=20
> Sorry again, but RTFM is no possible answer in PEAR, there I would say WA=

FRM
> (Write a XXXXing readable manual).
>=20
> Mirco Blitz
>=20
> -----Urspr=FCngliche Nachricht-----
> Von: Justin Patrin [mailto:papercrane@gmail.com]
> Gesendet: Donnerstag, 26. August 2004 19:49
> An: Yuan N Yudistira
> Cc: pear-general@lists.php.net
> Betreff: Re: [PEAR] two queries on the same object (Help)
>=20
> On Thu, 26 Aug 2004 15:55:32 +0700, Yuan N Yudistira
> <yuan@sabukhitam.net> wrote:
>=20
> <generatRant>
> <quote movie=3D"Zoolander" character=3D"Mugatu">
> I feel like I'm taking crazy pills!
> </quote>
> *WHY* does nearly every DataObject question have their dataobjects
> instantiated in this way?
>=20
> Ok, I suppose I understand...people aren't reading the full manual.
> The first page shows direct object instantiation. If you keep reading,
> however, you get to:
> http://pear.php.net/manual/en/packa...t.db-dataobjec=

t.f
> actory.php
> which shows you how to use DB_DataObject::factory(). I'll ask the
> maintainers to change the intro page.
> </generalRant>
>=20
> The preferred method is:
> $oClient =3D& DataObject::factory('client');
>=20
>=20
> I don't see anywhere in your code that should generate this error.
> What line is it happening on? Perhaps it's on the $oRateType object?
> This error means that you're using the same DataObject for two
> different queries.
>=20
> --
> DB_DataObject_FormBuilder - The database at your fingertips
> http://pear.php.net/package/DB_DataObject_FormBuilder
>=20
> paperCrane --Justin Patrin--
>=20
> --
> PEAR General Mailing List (http://pear.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>=20
> ____________
> Virus checked by Antivirus-Profi-Paket
> Version: AVK 14.0.1805 from 11.08.2004
> Virus news: www.antiviruslab.com
>=20
> --
> PEAR General Mailing List (http://pear.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>=20
> !DSPAM:412deace312742027110848!
>=20
>=20



--=20
DB_DataObject_FormBuilder - The database at your fingertips
http://pear.php.net/package/DB_DataObject_FormBuilder

paperCrane --Justin Patrin--
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com