RE: Using DataObjects DB Error: Not Found
| From: | Hooimeijer, Martijn | Date: | Tue, 21 Jan 2003 12:17:13 +0000 |
| Subject: | RE: Using DataObjects DB Error: Not Found | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-3385@lists.php.net to get a copy of this message | ||
Hi Alan,
Thanks for the reply!
Yes, it must be something simple like that. I am just wondering: where do I
put the code. In the generating of the code or in the use of the dataobject.
I noticed that the $_database_dsn attribute was not generated into the
dataobjects, so I added it manually (for now!). Then a connection to the
database is possible.
I could then retrieve data using
dataobject->get(name, value).
Somehow the primary keys are not recognized and performing a
dataobject->get(1)
gives "ERROR No Keys available for persons", although the keys are given in
the database.ini file. I guess this file is not picked up. It is unclear to
me how and where these files are going to be picked up and by what
mechanism, so it is difficult to know what goes wrong where. The internals
of the DataObject are a bit of a mystery to me, even after staring at the
code for some time.
I want to conclude on a positive note though. I really like this package
very much, because it provides a professional interface to databases,
somewhat comparable to entity beans in a J2EE architecture. Keep up the good
work!
Martijn
-----Original Message-----
From: Alan Knowles [mailto:alan@akbkhome.com]
Sent: Tuesday 21 January 2003 04:19
To: Martijn Hooimeijer
Cc: 'pear-general@lists.php.net'
Subject: Re: Using DataObjects DB Error: Not Found
Have a go with the latest release, - it looks likely however that you
have failed to load the config data into
PEAR::getStaticPropery('DB_DataObject','options');
try just
print_r(PEAR::getStaticPropery('DB_DataObject','options'));
and see if there is any data in there
Regards
Alan
Martijn Hooimeijer wrote:
> Hello,
>
> 6 months ago I had generated and used DataObjects succesfully. I recently
> updated my Pear system (PEAR it self, and the DB DataObjects
functionality.
> The DB package already was the latest version).
>
> I could generate the DataObjects, but using them generated errors:
>
> DataObject.php: line 977; Undefined index: table_tablename
> DataObject.php: line 981; Undefined index: database
> DB.php: 260 Failed Opening 'DB/.php' for inclusion.
>
> The output from the DataObject generated: DB Error: not found.
>
> BTW. I did not change the DataObjects.
>
> I then reinstalled DB_DataObject 0.8. I then got errors that the database
> belonging to my database could not be found and the DataObjects would
> generate at all.
>
> What's up!
>
>
> Martijn Hooimeijer
>
> LogicaCMG
> Wijhaven 69
> 3011 WJ Rotterdam
> PO Box 22067
> 3003 DB Rotterdam
> T:+31 (0)10 206 1143
> F: +31 (0)10 206 11 00
> E: Martijn.Hooimeijer@logicacmg.com
> www.logicacmg.com
>
>
> This e-mail and any attachment is for authorised use by the intended
recipient(s) only. It may contain proprietary material, confidential
information and/or be subject to legal privilege. It should not be copied,
disclosed to, retained or used by, any other party. If you are not an
intended recipient then please promptly delete this e-mail and any
attachment and all copies and inform the sender. Thank you.
This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may
contain proprietary material, confidential information and/or be subject to legal privilege. It
should not be copied, disclosed to, retained or used by, any other party. If you are not an
intended recipient then please promptly delete this e-mail and any attachment and all copies and
inform the sender. Thank you.