MIOLO20
Carregando...
Procurando...
Nenhuma entrada encontrada
mquery.class
Ir para a documentação deste ficheiro.
1
<?php
6
class
FirebirdQuery
extends
MQuery
7
{
11
var
$id_result
;
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
{
85
$error
=
ibase_errmsg
();
86
return
$error
;
87
}
88
96
function
_close
()
97
{
98
if
($this->
id_result
)
99
ibase_free_result
($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
{
117
$col_info
=
ibase_field_info
($this->
id_result
,
$i
);
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
136
function
_getmetatype
(
$type
)
137
{
138
$type
=
strtoupper
(
$type
);
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
?>
FirebirdQuery
Definição
mquery.class:7
FirebirdQuery\__construct
__construct()
Definição
mquery.class:20
FirebirdQuery\_querystmt
_querystmt($stmt)
Definição
mquery.class:71
FirebirdQuery\_close
_close()
Definição
mquery.class:96
FirebirdQuery\_setmetadata
_setmetadata()
Definição
mquery.class:109
FirebirdQuery\_error
_error()
Definição
mquery.class:83
FirebirdQuery\_query
_query()
Definição
mquery.class:32
FirebirdQuery\$id_result
$id_result
Definição
mquery.class:11
FirebirdQuery\_getmetatype
_getmetatype($type)
Definição
mquery.class:136
MDataSet\$colCount
$colCount
Definição
mdataset.class:26
MDataSet\$type
$type
Definição
mdataset.class:46
MDataSet\$row
$row
Definição
mdataset.class:16
MQuery
Definição
mquery.class:3
MQuery\$sql
$sql
Definição
mquery.class:6
MQuery\$error
$error
Definição
mquery.class:7
sql
Definição
compatibility.class:18
classes
database
firebird
mquery.class
Gerado por
1.10.0