MIOLO20
Carregando...
Procurando...
Nenhuma entrada encontrada
mquery.class
Ir para a documentação deste ficheiro.
1<?php
6class FirebirdQuery extends MQuery
7{
12
20 function __construct()
21 {
22 parent::__construct();
23 }
24
32 function _query()
33 {
34 $this->fetched = false;
35 $str = 'SELECT ';
36
37 if ($this->maxrows > 0)
38 $str .= "FIRST $this->maxrows ";
39
40 $str .= ($this->offset > 0) ? "SKIP $this->offset " : '';
41 $this->sql = preg_replace('/^[ \t]*select/i', $str, $this->sql);
42 $this->sql = str_replace('password', "\"PASSWORD\"", $this->sql);
43 $this->id_result = ibase_query($this->conn->id, $this->sql, $sql->parameters);
44 $this->error = $this->_error();
45
46 if (!$this->error)
47 {
48 $this->rowCount = 0;
49
50 while ($results = ibase_fetch_row($this->id_result))
51 {
52 $this->result[$this->rowCount++] = $results;
53 }
54
55 $this->fetched = true;
56 $this->colCount = ibase_num_fields($this->id_result);
57 }
58
59 return (!$this->error);
60 }
61
71 function _querystmt($stmt)
72 {
73 $this->_query();
74 }
75
83 function _error()
84 {
86 return $error;
87 }
88
96 function _close()
97 {
98 if ($this->id_result)
100 }
101
109 function _setmetadata()
110 {
111 $numCols = $this->colCount;
112 $this->metadata = array(
113 );
114
115 for ($i = 0; $i < $numCols; $i++)
116 {
118 $alias = strtoupper($col_info['alias']);
119 $name = ($alias != '') ? $alias : strtoupper($col_info['name']);
120 $this->metadata['fieldname'][$i] = $name;
121 $this->metadata['fieldtype'][$name] = $this->_getmetatype($col_info['type']);
122 $this->metadata['fieldlength'][$name] = $col_info['length'];
123 $this->metadata['fieldpos'][$name] = $i;
124 }
125 }
126
137 {
139 $rType = 'N';
140
141 if ($type == "VARCHAR")
142 {
143 $rType = 'C';
144 }
145 elseif ($type == "CHAR")
146 {
147 $rType = 'C';
148 }
149 elseif ($type == "NUMBER")
150 {
151 $rType = 'N';
152 }
153 elseif ($type == "INTEGER")
154 {
155 $rType = 'N';
156 }
157 elseif ($type == "DATE")
158 {
159 $rType = 'T';
160 }
161 elseif ($type == "TIMESTAMP")
162 {
163 $rType = 'T';
164 }
165
166 return $rType;
167 }
168}
169?>
_querystmt($stmt)
Definição mquery.class:71
_getmetatype($type)
Definição mquery.class:136
$error
Definição mquery.class:7