Re: modifyLimitQuery for ibase.php

From: Date: Mon, 07 Jan 2002 16:21:38 +0000
Subject: Re: modifyLimitQuery for ibase.php
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-3807@lists.php.net to get a copy of this message
El lun, 07-01-2002 a las 12:31, Ludovico Magnocavallo escribió: > uses the new first n skip n syntax of Firebird 1.0 Hi Ludovico, Does this patch works also with the standar Interbase distrib? If not, what do you think about making it avaible under a new syntaxis of the ibase driver (ej: ibase(firebird)://user:pass@..) ? Thanks for the patch, I'll commit it. Tomas V.V.Cox > 249a250,275 > > > > // {{{ modifyLimitQuery() > > > > /** > > * This method is used by backends to alter limited queries > > * Uses the new FIRST n SKIP n Firebird 1.0 syntax, so it is > > * only compatible with Firebird 1.x > > * > > * @param string $query query to modify > > * @param integer $from the row to start to fetching > > * @param integer $count the numbers of rows to fetch > > * > > * @return the new (modified) query > > * > > * @access private > > */ > > > > function modifyLimitQuery($query, $from, $count) > > { > > $from++; // SKIP starts from 1, ie SKIP 1 starts from the first > record, not skipping anything > > $query = preg_replace('/^\s*select\s(.*)$/i', "SELECT FIRST $count > SKIP $from $1", $query); > > return $query; > > } > > > > // }}} > > > > > > -- > PEAR Development Mailing List (http://pear.php.net/) > To unsubscribe, e-mail: pear-dev-unsubscribe@lists.php.net > For additional commands, e-mail: pear-dev-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.pear.dev (#3807) next »