cvs: pear /DB/DB fbsql.php

From: Date: Thu, 16 Dec 2004 18:45:00 +0000
Subject: cvs: pear /DB/DB fbsql.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-27499@lists.php.net to get a copy of this message
fmk Thu Dec 16 13:45:00 2004 EDT Modified files: /pear/DB/DB fbsql.php Log: implemnet LIMIT with native frontbase syntax http://cvs.php.net/diff.php/pear/DB/DB/fbsql.php?r1=1.43&r2=1.44&ty=u Index: pear/DB/DB/fbsql.php diff -u pear/DB/DB/fbsql.php:1.43 pear/DB/DB/fbsql.php:1.44 --- pear/DB/DB/fbsql.php:1.43 Thu Dec 16 13:39:04 2004 +++ pear/DB/DB/fbsql.php Thu Dec 16 13:45:00 2004 @@ -17,7 +17,7 @@ // | Maintainer: Daniel Convissor <danielc@php.net> | // +----------------------------------------------------------------------+ // -// $Id: fbsql.php,v 1.43 2004/12/16 18:39:04 fmk Exp $ +// $Id: fbsql.php,v 1.44 2004/12/16 18:45:00 fmk Exp $ // XXX legend: @@ -37,7 +37,7 @@ * extension. * * @package DB - * @version $Id: fbsql.php,v 1.43 2004/12/16 18:39:04 fmk Exp $ + * @version $Id: fbsql.php,v 1.44 2004/12/16 18:45:00 fmk Exp $ * @category Database * @author Frank M. Kromann <frank@frontbase.com> */ @@ -69,7 +69,7 @@ 'prepare' => false, 'pconnect' => true, 'transactions' => true, - 'limit' => 'emulate' + 'limit' => 'alter' ); $this->errorcode_map = array( 22 => DB_ERROR_SYNTAX, @@ -485,6 +485,18 @@ } // }}} + // {{{ modifyLimitQuery() + + function modifyLimitQuery($query, $from, $count, $params = array()) + { + if (DB::isManip($query)) { + return str_ireplace("SELECT", "SELECT TOP($count)", $query); + } else { + return str_ireplace("SELECT", "SELECT TOP($from, $count)", $query); + } + } + + // }}} // {{{ quoteSmart() /**

« previous php.pear.cvs (#27499) next »