Re: DB_QueryTool without extends
| From: | Wolfram Kriesing | Date: | Mon, 15 Sep 2003 15:50:34 +0000 |
| Subject: | Re: DB_QueryTool without extends | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-7818@lists.php.net to get a copy of this message | ||
Jackson Miller wrote:
Is it possible to useDB_QueryTool without extending the class? Ideally I would like to be able to pass an existing DB connection reference, but at the least just pass the DSN. I would like to do the following $query = new DB_QueryTool("[dsn || DB reference]"); $query->reset(); $query->setTable("main_table");there is no setTable() method yet, instead you can use $query->table = 'main_table'; that should be added, i agree otherwise you can use it without extending, i guess.
$query->addSelect("id"); $query->addSelect("name"); $query->addSelect("group"); $query->addJoin('groups','member.group=groups.group_id'); $query->addWhere('member.group > 5'); $query->setOrder('name'); $results = $query->getAll(); I am in the process of trying to test this now, but I am not sure how to pass the DB connection stuff.pass the DSN to the constructor! -- Wolfram ... opensource @ vision:produktion ... http://opensource.visionp.de ... authentication system .... http://sf.net/projects/auth