Re: DB_QueryTool without extends

From: Date: Mon, 15 Sep 2003 15:41:41 +0000
Subject: Re: DB_QueryTool without extends
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-7815@lists.php.net to get a copy of this message
Sorry, I had a confusing mistake in the example. The example should read: $query = new DB_QueryTool("[dsn || DB reference]"); $query->reset(); $query->setTable("main_table"); $query->addSelect("id"); $query->addSelect("name"); $query->addSelect("group"); $query->addJoin('groups','main_table.group=groups.group_id'); $query->addWhere('main_table.group > 5'); $query->setOrder('name'); $results = $query->getAll(); On Monday 15 September 2003 10:37, 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"); > > $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. > > Thanks, > -Jackson > > > -- > jackson miller > > cold feet creative > 615.321.3300 / 800.595.4401 > jackson@coldfeetcreative.com >   >   > cold feet presents Emma > the world's easiest email marketing > Learn more @  http://www.myemma.com -- jackson miller cold feet creative 615.321.3300 / 800.595.4401 jackson@coldfeetcreative.com     cold feet presents Emma the world's easiest email marketing Learn more @  http://www.myemma.com

« previous php.pear.general (#7815) next »