當前位置: 首頁>>代碼示例>>PHP>>正文


PHP SqlParser::html方法代碼示例

本文整理匯總了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);
開發者ID:qbdsoft,項目名稱:Query-Digest-UI,代碼行數:30,代碼來源:descTable.php

示例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);
開發者ID:qbdsoft,項目名稱:Query-Digest-UI,代碼行數:31,代碼來源:sample.php


注:本文中的SqlParser::html方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。