Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

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
>
> 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
>
> What does it mean?
>
> Where to go to find meaning of error code lika this ?
>
> Thanks
>
> YUAN
>
> Ps. I use  Pear on Seagull Frame work and
>
> here is a piece of code i am trying to do :
>
>          // Generate select box of Client specific to entity
>          $oClient = & new DataObjects_Client();

<generatRant>
<quote movie="Zoolander" character="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...ory
.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 =& DataObject::factory('client');

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

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.

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

paperCrane --Justin Patrin--

Report this thread to moderator Post Follow-up to this message
Old Post
Justin Patrin
08-26-04 09:00 PM


Re: [PEAR] two queries on the same object (Help)
Dear Mr.Justin

I have fixed the error.

Thanks

YUAN
----- Original Message -----
From: "Justin Patrin" <papercrane@gmail.com>
To: "Yuan N Yudistira" <yuan@sabukhitam.net>
Cc: <pear-general@lists.php.net>
Sent: Friday, August 27, 2004 12:48 AM
Subject: 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: 
>
> <generatRant>
> <quote movie="Zoolander" character="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...db-dataobject.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 =& DataObject::factory('client');
> 
>
> 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.
>
> --
> DB_DataObject_FormBuilder - The database at your fingertips
> http://pear.php.net/package/DB_DataObject_FormBuilder
>
> paperCrane --Justin Patrin--
>
>
>

Report this thread to moderator Post Follow-up to this message
Old Post
Yuan N Yudistira
08-27-04 01:57 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PHP Pear archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 04:51 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.