Re: DataObject - DB Error : not found
| From: | Alan Knowles | Date: | Wed, 17 Jul 2002 13:06:47 +0000 |
| Subject: | Re: DataObject - DB Error : not found | ||
| References: | 1 2 3 4 5 6 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-1908@lists.php.net to get a copy of this message | ||
William wrote:
Thanks! I have put the lines altogether, but the result is the same; "DB Error: not found". Here is my codes, <?php require_once ('PEAR.php'); require_once ('DB\DataObject.php'); DB_DataObject::debugLevel(5); $options = &PEAR::getStaticProperty('DB_DataObject','options'); $config = parse_ini_file('soccer.ini', TRUE); try print_r($config); here - has it got an array for DB_DataObject?
$options = $config['DB_DataObject']; require_once ('Competition.php'); $comp = new DataObjects_Competition; $comp->get(3); print_r($comp); ?> And I have this in php error log, 'PHP Notice: Undefined index: DB_DataObject in c:\project\testing\pear\dataobjects\test1.php on line 9' Sorry to bother you with this silly things! :-( It's ok, its been very usefull for seeing where the documentation is missing - hopefully when alexander finishes of peardoc2, then we can have comments on the manual - it should help alot..regards alan
Cheers, William ----- Original Message ----- From: "Alan Knowles" <alan@akbkhome.com> To: "William" <william@adtio.com> Cc: <pear-general@lists.php.net> Sent: Wednesday, July 17, 2002 6:38 PM Subject: Re: [PEAR] DataObject - DB Error : not foundHave you loaded the configuration:http://pear.php.net/manual/en/packages.database.db-dataobject.introduction.p hp| require_once('PEAR.php');on$options = &PEAR::getStaticProperty('DB_DataObject','options'); $config = parse_ini_file('example.ini',TRUE); $options = $config['DB_DataObject'];// use one of the extended classes.require_once('DataObjects/Person.php');I guess the other examples should illustrate this somehow you can always turn on debugging to get more details about what is goingDB_DataObject::debugLevel(5); regards alan | William wrote:meaningHi, I follow the manual on the pear.php.net and runs these <?php require_once('Person.php'); $person = new DataObjects_Person; $person->get(1); print_r($person); ?> I only have 'DB Error : not found' printed on the paper. What's theof it? I am sure the table and record are exists there and I made the DataObject Classes by Auto Builder. Thanks in advance! Cheers, William-- PEAR General Mailing List (http://pear.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php