36 |
kaklik |
1 |
<?php
|
|
|
2 |
/*
|
|
|
3 |
V4.80 8 Mar 2006 (c) 2000-2006 John Lim (jlim@natsoft.com.my). All rights reserved.
|
|
|
4 |
Released under both BSD license and Lesser GPL library license.
|
|
|
5 |
Whenever there is any discrepancy between the two licenses,
|
|
|
6 |
the BSD license will take precedence.
|
|
|
7 |
Set tabs to 4 for best viewing.
|
|
|
8 |
|
|
|
9 |
Latest version is available at http://adodb.sourceforge.net
|
|
|
10 |
|
|
|
11 |
*/
|
|
|
12 |
|
|
|
13 |
// security - hide paths
|
|
|
14 |
if (!defined('ADODB_DIR')) die();
|
|
|
15 |
|
|
|
16 |
include_once(ADODB_DIR."/drivers/adodb-ibase.inc.php");
|
|
|
17 |
|
|
|
18 |
class ADODB_firebird extends ADODB_ibase {
|
|
|
19 |
var $databaseType = "firebird";
|
|
|
20 |
var $dialect = 3;
|
|
|
21 |
|
|
|
22 |
var $sysTimeStamp = "cast('NOW' as timestamp)";
|
|
|
23 |
|
|
|
24 |
function ADODB_firebird()
|
|
|
25 |
{
|
|
|
26 |
$this->ADODB_ibase();
|
|
|
27 |
}
|
|
|
28 |
|
|
|
29 |
function ServerInfo()
|
|
|
30 |
{
|
|
|
31 |
$arr['dialect'] = $this->dialect;
|
|
|
32 |
switch($arr['dialect']) {
|
|
|
33 |
case '':
|
|
|
34 |
case '1': $s = 'Firebird Dialect 1'; break;
|
|
|
35 |
case '2': $s = 'Firebird Dialect 2'; break;
|
|
|
36 |
default:
|
|
|
37 |
case '3': $s = 'Firebird Dialect 3'; break;
|
|
|
38 |
}
|
|
|
39 |
$arr['version'] = ADOConnection::_findvers($s);
|
|
|
40 |
$arr['description'] = $s;
|
|
|
41 |
return $arr;
|
|
|
42 |
}
|
|
|
43 |
|
|
|
44 |
// Note that Interbase 6.5 uses this ROWS instead - don't you love forking wars!
|
|
|
45 |
// SELECT col1, col2 FROM table ROWS 5 -- get 5 rows
|
|
|
46 |
// SELECT col1, col2 FROM TABLE ORDER BY col1 ROWS 3 TO 7 -- first 5 skip 2
|
|
|
47 |
function &SelectLimit($sql,$nrows=-1,$offset=-1,$inputarr=false, $secs=0)
|
|
|
48 |
{
|
|
|
49 |
$nrows = (integer) $nrows;
|
|
|
50 |
$offset = (integer) $offset;
|
|
|
51 |
$str = 'SELECT ';
|
|
|
52 |
if ($nrows >= 0) $str .= "FIRST $nrows ";
|
|
|
53 |
$str .=($offset>=0) ? "SKIP $offset " : '';
|
|
|
54 |
|
|
|
55 |
$sql = preg_replace('/^[ \t]*select/i',$str,$sql);
|
|
|
56 |
if ($secs)
|
|
|
57 |
$rs =& $this->CacheExecute($secs,$sql,$inputarr);
|
|
|
58 |
else
|
|
|
59 |
$rs =& $this->Execute($sql,$inputarr);
|
|
|
60 |
|
|
|
61 |
return $rs;
|
|
|
62 |
}
|
|
|
63 |
|
|
|
64 |
|
|
|
65 |
};
|
|
|
66 |
|
|
|
67 |
|
|
|
68 |
class ADORecordSet_firebird extends ADORecordSet_ibase {
|
|
|
69 |
|
|
|
70 |
var $databaseType = "firebird";
|
|
|
71 |
|
|
|
72 |
function ADORecordSet_firebird($id,$mode=false)
|
|
|
73 |
{
|
|
|
74 |
$this->ADORecordSet_ibase($id,$mode);
|
|
|
75 |
}
|
|
|
76 |
}
|
|
|
77 |
?>
|