本文整理汇总了PHP中SqlParser::html方法的典型用法代码示例。如果您正苦于以下问题:PHP SqlParser::html方法的具体用法?PHP SqlParser::html怎么用?PHP SqlParser::html使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SqlParser
的用法示例。
在下文中一共展示了SqlParser::html方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
require_once 'init.php';
$return = array();
$label = $_REQUEST['label'];
$database = $_REQUEST['db'];
$table = $_REQUEST['table'];
$return['label'] = $label;
$return['database'] = $database;
$return['table'] = $table;
$return['column'] = $col;
$return['title'] = "{$database}.{$table}";
$host = $explainhosts[$label];
Database::connect(null, $host['user'], $host['password'], null, null, 'pdo', array('dsn' => $host['dsn']), $label);
Database::find($label)->query('USE ' . Database::escapeField($database));
list($tmp, $return['create']) = Database::find($label)->query_row('SHOW CREATE TABLE ' . Database::escapeField($table));
$return['create'] = SqlParser::html($return['create']);
$desc = Database::find($label)->query_list_assoc('DESC ' . Database::escapeField($table));
$return['desc'] = '<table><thead><tr>';
foreach (array_keys($desc[0]) as $key) {
$return['desc'] .= '<th>' . $key . '</th>';
}
$return['desc'] .= '</tr></thead><tbody>';
foreach ($desc as $row) {
$return['desc'] .= '<tr>';
foreach ($row as $key => $val) {
$return['desc'] .= '<td>' . ifnull($val, 'NULL') . '</td>';
}
$return['desc'] .= '</tr>';
}
$return['desc'] .= '</tbody></table>';
unset($desc);
示例2: intval
$primaryKey .= ", {$field} ";
}
}
$offset = 0;
if (isset($_REQUEST['offset']) && $_REQUEST['offset'] > 0) {
$offset = intval($_REQUEST['offset']);
}
$res = Database::find('review')->query('SELECT review.sample ' . $primaryKey . '
FROM ' . Database::escapeField($reviewhost['history_table']) . ' AS review
WHERE review.checksum = ?
ORDER BY review.ts_max DESC
LIMIT 1
OFFSET ' . $offset, $_REQUEST['checksum']);
$row = $res->fetch_assoc();
$return['sample'] = $row['sample'];
foreach ($reviewhost['history_table_primary'] as $field) {
$return['primary'][$field] = $row[$field];
}
$return['offset'] = $offset;
} else {
$return['sample'] = Database::find('review')->query_col('SELECT review.sample
FROM ' . Database::escapeField($reviewhost['review_table']) . ' AS review
WHERE review.checksum = ?', $_REQUEST['checksum']);
}
if (strlen($return['sample'])) {
$return['sample'] = SqlParser::html($return['sample']);
}
header('Cache-Control: no-cache, must-revalidate');
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Content-type: application/json');
echo json_encode($return);