示例#1
0
            //					$name .= "  (". $fieldValue. ")";
        }
        if ($ii == 2) {
            //					$name .= $fieldValue;
            $name .= "  (" . $fieldValue . ")";
            $res_all[$name]['templateName'] = $name;
        }
        if ($ii > 2) {
            $res_all[$name][$fieldName] = $fieldValue;
        }
    }
}
//		deg($res_all);
$db = new DbMySql($query_sum);
while ($db->nextRecord()) {
    $record = $db->getRecord();
    $ii = 0;
    foreach ($record as $fieldName => $fieldValue) {
        $ii++;
        if ($ii == 2) {
            $name = 'TOTAL';
        }
        if ($ii == 3) {
            $res_total[$name][$fieldName] = '';
        }
        if ($ii > 3) {
            $res_total[$name][$fieldName] = $fieldValue;
        }
    }
}
if (isset($filters['column']) && !empty($filters['column'])) {
示例#2
0
<?php

function getTables()
{
    $query = "SHOW TABLES";
    $q = new DbMySql($query);
    $tables = array();
    while ($q->nextRecord()) {
        $tables[] = $q->f('Tables_in_' . $q->database);
    }
    return $tables;
}
$tables = getTables();
$ret = array();
if (!empty($tables)) {
    $tables = '`' . implode("`, `", $tables) . '`';
    $q = new DbMySql(" OPTIMIZE TABLE {$tables}");
    while ($q->nextRecord()) {
        $ret[] = $q->getRecord();
    }
}
$smarty->assign('result', $ret);