RE: [PEAR] DataObject find() error
| From: | LIMBOURG Arnaud | Date: | Thu, 12 Dec 2002 17:07:38 +0000 |
| Subject: | RE: [PEAR] DataObject find() error | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-2959@lists.php.net to get a copy of this message | ||
> Hi Guys,
>
> I've got a little further now - I'm setting up my instance of a
> DataObject inside a class method I've written:
>
> function listMembers($contractedId = -1) {
> if($contractedId == -1) {
> return false;
> }
>
> $options =
> &PEAR::getStaticProperty('DB_DataObject','options');
> $config = parse_ini_file('redbox_databases.ini', TRUE);
> $options = $config['DB_DataObject'];
> unset($options);
Why do you unset $options ???????
DataObjects needs it, the DSN is in there, that's why you get the error ;))
Plus, do a
function &listMembers($contractedId = -1) {
Because you want a reference returned by the method and not a copy :)
With that it'll work.
Arnaud
> DB_DataObject::debugLevel(5);
>
> $members = new dataObjects_Member;
>
> $members->contracted_id = $contractedId;
> $members->orderBy("name");
> $members->groupBy("type");
>
> $rows = $members->find();
>
> if($rows) {
> var_dump($members);
> }
>
> }
>
> However in another script when I call this method and pass in a
> parameter... I get the message:
> __find
> CONNECT NEW CONNECTION
> CONNECT d41d8cd98f00b204e9800998ecf8427e
> CONNECT
> a:1:{s:32:"d41d8cd98f00b204e9800998ecf8427e";O:8:"db_error":7:
> {s:20:"err
>
> or_message_prefix";s:0:"";s:4:"mode";i:1;s:5:"level";i:1024;s:
> 4:"code";i
> :-4;s:7:"message";s:19:"DB Error: not
> found";s:8:"userinfo";s:41:"Unable
> to include the DB/.php file for `'";s:8:"callback";N;}}
> DB Error: not found
>
> My DSN is: mysql://k0agr0up:password@dev1.koa.uk.com/medicalrecord
>
> I can't seem to work out why it has a message about not being able to
> include a file? Surely it should be looking for DB/mysql.php ??
>
> - Mike Carter
>
> --
> Mike Carter [web developer]
> tel: 01925 758229 // fax: 01925 758023 // web: www.koa.uk.com
>
> This message is confidential.
> Unless you are the named addressee or their delegated
> representative you
> may not use, disclose, or copy the contents of the e-mail. If you are
> not the named addressee please notify the sender immediately
> and delete
> the material from your computer. Any views or opinions
> contained in this
> e-mail are solely those of the author unless expressly stated
> otherwise
>
>
> --
> PEAR General Mailing List (http://pear.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>