DB_DataObject
| From: | Chris Boget | Date: | Thu, 21 Sep 2006 21:28:56 +0000 |
| Subject: | DB_DataObject | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-25193@lists.php.net to get a copy of this message | ||
I'm having a problem using it to get all the records from the table. I've got a class, Users, that extends DB_DataObject (generated using createTables.php). If I just want to get a subset, this works perfectly fine:
$users = new Users();
$users->country = 'USA';
$users->find();
Ok, so now I just want to get all the users. So after reading the DB_Object documentation (and the source code), the closest I was able to determine how to do this is as follows:
$users = new Users()
$users->selectAdd('*')
//$users->find(); // Actually, I'm not even sure this is needed
So the only change in my code is to use selectAdd() instead. If I make that change, I get an error message saying:
"DB_DataObject Error: No database name / dsn found anywhere"
Why am I getting that? Everything worked fine enough for the first example.
Also, am I doing the right thing to get all the records in the table?
thnx,
Chris