mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-01 08:12:17 +09:00
new DBClasses for SQLite3 and Firebird databases.
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0-DB@8555 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
01d0925dd5
commit
5d1eb1c21e
7 changed files with 218 additions and 65 deletions
|
|
@ -489,8 +489,16 @@
|
|||
$query .= (__DEBUG_QUERY__&1 && $output->query_id)?sprintf(' '.$this->comment_syntax,$this->query_id):'';
|
||||
$result = $this->_query($query);
|
||||
|
||||
if ($this->isError ()) {
|
||||
if ($queryObject->getLimit() && $queryObject->getLimit()->isPageHandler()){
|
||||
if ($this->isError ()) return $this->queryError($queryObject);
|
||||
else return $this->queryPageLimit($queryObject, $result);
|
||||
}
|
||||
|
||||
function getParser(){
|
||||
return new DBParser("[", "]");
|
||||
}
|
||||
|
||||
function queryError($queryObject){
|
||||
if ($queryObject->getLimit() && $queryObject->getLimit()->isPageHandler()){
|
||||
$buff = new Object ();
|
||||
$buff->total_count = 0;
|
||||
$buff->total_page = 0;
|
||||
|
|
@ -500,9 +508,10 @@
|
|||
return $buff;
|
||||
}else
|
||||
return;
|
||||
}
|
||||
|
||||
if ($queryObject->getLimit() && $queryObject->getLimit()->isPageHandler()) {
|
||||
}
|
||||
|
||||
function queryPageLimit($queryObject, $result){
|
||||
if ($queryObject->getLimit() && $queryObject->getLimit()->isPageHandler()) {
|
||||
// Total count
|
||||
$count_query = sprintf('select count(*) as "count" %s %s', 'FROM ' . $queryObject->getFromString(), ($queryObject->getWhereString() === '' ? '' : ' WHERE '. $queryObject->getWhereString()));
|
||||
if ($queryObject->getGroupByString() != '') {
|
||||
|
|
@ -519,7 +528,6 @@
|
|||
$total_page = (int) (($total_count - 1) / $queryObject->getLimit()->list_count) + 1;
|
||||
} else $total_page = 1;
|
||||
|
||||
|
||||
$virtual_no = $total_count - ($queryObject->getLimit()->page - 1) * $queryObject->getLimit()->list_count;
|
||||
$data = $this->_fetch($result, $virtual_no);
|
||||
|
||||
|
|
@ -534,13 +542,8 @@
|
|||
$buff = new Object ();
|
||||
$buff->data = $data;
|
||||
}
|
||||
|
||||
return $buff;
|
||||
}
|
||||
|
||||
function getParser(){
|
||||
return new DBParser("[", "]");
|
||||
}
|
||||
return $buff;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue