fixed problems pointed out by Janosch Machowinski <scotch-AT-tzi.de>

This commit is contained in:
Ralf Becker
2007-05-25 12:18:00 +00:00
parent cbff451d7e
commit 1e9b08d510
4 changed files with 17 additions and 15 deletions

View File

@@ -35,12 +35,12 @@ class ADODB_postgres7 extends ADODB_postgres64 {
// which makes obsolete the LIMIT limit,offset syntax
function &SelectLimit($sql,$nrows=-1,$offset=-1,$inputarr=false,$secs2cache=0)
{
$offsetStr = ($offset >= 0) ? " OFFSET $offset" : '';
$limitStr = ($nrows >= 0) ? " LIMIT $nrows" : '';
$offsetStr = ($offset >= 0) ? ' OFFSET '.(int)$offset : '';
$limitStr = ($nrows >= 0) ? ' LIMIT '.(int)$nrows : '';
if ($secs2cache)
$rs =& $this->CacheExecute($secs2cache,$sql."$limitStr$offsetStr",$inputarr);
$rs =& $this->CacheExecute($secs2cache,$sql.$limitStr.$offsetStr,$inputarr);
else
$rs =& $this->Execute($sql."$limitStr$offsetStr",$inputarr);
$rs =& $this->Execute($sql.$limitStr.$offsetStr,$inputarr);
return $rs;
}