mirror of
https://github.com/vrana/adminer.git
synced 2025-08-08 15:47:00 +02:00
IMAP: Number of rows
This commit is contained in:
@@ -39,7 +39,10 @@ if (isset($_GET["imap"])) {
|
||||
function query($query, $unbuffered = false) {
|
||||
if (preg_match('~DELETE FROM "(.+?)"~', $query)) {
|
||||
preg_match_all('~"uid" = (\d+)~', $query, $matches);
|
||||
imap_delete($this->imap, implode(",", $matches[1]), FT_UID);
|
||||
return imap_delete($this->imap, implode(",", $matches[1]), FT_UID);
|
||||
} elseif (preg_match('~^SELECT COUNT\(\*\)\sFROM "(.+?)"~s', $query, $match)) {
|
||||
$status = table_status($match[1]);
|
||||
return new Result(array(array($status["Rows"])));
|
||||
} elseif (preg_match('~^SELECT (.+)\sFROM "(.+?)"(?:\sWHERE "uid" = (\d+))?.*?(?:\sLIMIT (\d+)(?:\sOFFSET (\d+))?)?~s', $query, $match)) {
|
||||
list(, $columns, $table, $uid, $limit, $offset) = $match;
|
||||
if ($uid) {
|
||||
@@ -109,6 +112,11 @@ if (isset($_GET["imap"])) {
|
||||
next($this->result);
|
||||
return $row;
|
||||
}
|
||||
|
||||
function fetch_row() {
|
||||
$row = $this->fetch_assoc();
|
||||
return ($row ? array_values($row) : false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user