MIOLO20
Carregando...
Procurando...
Nenhuma entrada encontrada
mquery.class
Ir para a documentação deste ficheiro.
1
<?php
6
class
SQLiteQuery
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
$this->
sql
= $this->
maxrows
? $this->
sql
.
" LIMIT $this->maxrows"
:
$this->sql
;
36
$this->
sql
= $this->
offset
? $this->
sql
.
" OFFSET $this->offset"
:
$this->sql
;
37
$this->
id_result
=
sqlite_query
($this->
conn
->id,
$this
->sql);
38
$this->error = $this->
_error
();
39
40
if
(!$this->error)
41
{
42
$this->rowCount =
sqlite_num_rows
($this->
id_result
);
43
44
for
(
$n
= 0;
$n
<
$this->rowCount
; $this->
result
[
$n
++] =
sqlite_fetch_array
($this->
id_result
,
SQLITE_NUM
))
45
;
46
47
$this->
fetched
=
true
;
48
$this->
colCount
=
sqlite_num_fields
($this->
id_result
);
49
}
50
else
51
{
52
throw
new
EDatabaseQueryException
($this->error);
53
}
54
55
return
(!$this->error);
56
}
57
65
function
_error
()
66
{
67
return
((
$error
=
sqlite_last_error
($this->
conn
->id)) ?
sqlite_error_string
(
$error
) :
false
);
68
}
69
77
function
_close
()
78
{
79
if
($this->
id_result
)
80
unset
($this->
id_result
);
81
}
82
90
function
_setmetadata
()
91
{
92
$numCols =
$this->colCount
;
93
$this->
metadata
=
array
94
(
95
);
96
97
for
(
$i
= 0;
$i
< $numCols;
$i
++)
98
{
99
$name =
strtoupper
(
sqlite_field_name
($this->
id_result
,
$i
));
100
$name = (
$p
=
strpos
($name,
'.'
)) ?
substr
($name,
$p
+ 1) : $name;
101
$this->
metadata
[
'fieldname'
][
$i
] = $name;
102
$this->
metadata
[
'fieldtype'
][$name] =
'C'
;
103
$this->
metadata
[
'fieldlength'
][$name] = 0;
104
$this->
metadata
[
'fieldpos'
][$name] =
$i
;
105
}
106
}
107
117
function
_getmetatype
(
$type
)
118
{
119
$type
=
strtoupper
(
$type
);
120
$rType
=
'N'
;
121
122
if
(
$type
==
"VARCHAR"
)
123
{
124
$rType
=
'C'
;
125
}
126
elseif
(
$type
==
"CHAR"
)
127
{
128
$rType
=
'C'
;
129
}
130
elseif
(
$type
==
"NUMBER"
)
131
{
132
$rType
=
'N'
;
133
}
134
elseif
(
$type
==
"INTEGER"
)
135
{
136
$rType
=
'N'
;
137
}
138
elseif
(
$type
==
"DATE"
)
139
{
140
$rType
=
'T'
;
141
}
142
elseif
(
$type
==
"TIMESTAMP"
)
143
{
144
$rType
=
'T'
;
145
}
146
147
return
$rType
;
148
}
149
}
150
?>
EDatabaseQueryException
Definição
mexception.class:62
MDataSet\$rowCount
$rowCount
Definição
mdataset.class:21
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
SQLiteQuery
Definição
mquery.class:7
SQLiteQuery\__construct
__construct()
Definição
mquery.class:20
SQLiteQuery\_close
_close()
Definição
mquery.class:77
SQLiteQuery\_setmetadata
_setmetadata()
Definição
mquery.class:90
SQLiteQuery\_error
_error()
Definição
mquery.class:65
SQLiteQuery\_query
_query()
Definição
mquery.class:32
SQLiteQuery\$id_result
$id_result
Definição
mquery.class:11
SQLiteQuery\_getmetatype
_getmetatype($type)
Definição
mquery.class:117
sql
Definição
compatibility.class:18
classes
database
sqlite
mquery.class
Gerado por
1.10.0