Re: QueryTool questions
| From: | Wolfram Kriesing | Date: | Mon, 15 Sep 2003 20:14:56 +0000 |
| Subject: | Re: QueryTool questions | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-7826@lists.php.net to get a copy of this message | ||
Rob Hutton wrote:
You would have to do _construct(&$dsn) for this to work, otherwise a copy of the DB object is passed, not a reference, and a new connection may or may not be created (depending on the state when it was passed). Also, this would require that the DSN is a variable which would break BC. I would recommend instead that a setDBConnection(&$dbCon) or similar function be added and the $dsn parameter to _construct be made optional...yeah, right. thanks for this hint. i think it would have broken my apps too :-)
Thanks, Rob-- Wolfram http://opensource.visionp.de ... authentication system .... http://sf.net/projects/auth-----Original Message----- From: Wolfram Kriesing [mailto:lists@kriesing.de] Sent: Monday, September 15, 2003 2:13 PM To: Jackson Miller Cc: PEAR Subject: Re: [PEAR] QueryTool questions Jackson Miller wrote:I have two questions about QueryTool 1) Could a line be added to _construct to allow for using anexisting DBobject. Something along the lines of: if (DB::isConnection($dsn)) { // use that connection } else { if ($autoConnect) { $this->connect($dsn); } } The reason I ask for this is that it would make my life usingQueryTool withinmy application API classes a lot easier. On a high trafficsite I reallywant to keep DB connections to a minimum.of course this is possible, i will add it. i remember that that was on my todo anyway. sorry for being so slow :-)2) how do you set the LIMIT part of a query. Is that the getMultiple function? I ask becuase the documentation is a little lackingin that area. either use setLimit(<start>,<count>); getAll(); or getAll(<start>,<count>) getMultiple() is actually an extension to get(). get($id) gets the row for the given $id, where $id is compared to the primary column. And getMultiple($ids) works for multiple number of IDs. -- Wolfram http://opensource.visionp.de ... authentication system .... http://sf.net/projects/auth -- PEAR General Mailing List (http://pear.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php