本文整理汇总了PHP中PMA_DBI_fetch_result函数的典型用法代码示例。如果您正苦于以下问题:PHP PMA_DBI_fetch_result函数的具体用法?PHP PMA_DBI_fetch_result怎么用?PHP PMA_DBI_fetch_result使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了PMA_DBI_fetch_result函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: PMA_RTN_main
/**
* Main function for the routines functionality
*
* @return nothing
*/
function PMA_RTN_main()
{
global $db;
PMA_RTN_setGlobals();
/**
* Process all requests
*/
PMA_RTN_handleEditor();
PMA_RTN_handleExecute();
PMA_RTN_handleExport();
/**
* Display a list of available routines
*/
$columns = "`SPECIFIC_NAME`, `ROUTINE_NAME`, `ROUTINE_TYPE`, ";
$columns .= "`DTD_IDENTIFIER`, `ROUTINE_DEFINITION`";
$where = "ROUTINE_SCHEMA='" . PMA_Util::sqlAddSlashes($db) . "'";
$items = PMA_DBI_fetch_result("SELECT {$columns} FROM `INFORMATION_SCHEMA`.`ROUTINES` WHERE {$where};");
echo PMA_RTE_getList('routine', $items);
/**
* Display the form for adding a new routine, if the user has the privileges.
*/
echo PMA_RTN_getFooterLinks();
/**
* Display a warning for users with PHP's old "mysql" extension.
*/
if ($GLOBALS['cfg']['Server']['extension'] === 'mysql') {
trigger_error(__('You are using PHP\'s deprecated \'mysql\' extension, ' . 'which is not capable of handling multi queries. ' . '[strong]The execution of some stored routines may fail![/strong] ' . 'Please use the improved \'mysqli\' extension to ' . 'avoid any problems.'), E_USER_WARNING);
}
}
示例2: havePartitioning
/**
* checks if MySQL server supports partitioning
*
* @static
* @staticvar boolean $have_partitioning
* @staticvar boolean $already_checked
* @access public
* @return boolean
*/
public static function havePartitioning()
{
static $have_partitioning = false;
static $already_checked = false;
if (!$already_checked) {
if (PMA_MYSQL_INT_VERSION >= 50100) {
if (PMA_MYSQL_INT_VERSION < 50600) {
if (PMA_DBI_fetch_value("SHOW VARIABLES LIKE 'have_partitioning';")) {
$have_partitioning = true;
}
} else {
// see http://dev.mysql.com/doc/refman/5.6/en/partitioning.html
$plugins = PMA_DBI_fetch_result("SHOW PLUGINS");
foreach ($plugins as $value) {
if ($value['Name'] == 'partition') {
$have_partitioning = true;
break;
}
}
}
$already_checked = true;
}
}
return $have_partitioning;
}
示例3: getStorageEngines
/**
* returns array of storage engines
*
* @static
* @staticvar array $storage_engines storage engines
* @access public
* @uses PMA_DBI_fetch_result()
* @return array of storage engines
*/
public static function getStorageEngines()
{
static $storage_engines = null;
if (null !== $storage_engines) {
return $storage_engines;
}
return PMA_DBI_fetch_result('SHOW STORAGE ENGINES', 'Engine');
}
示例4: getPartitionNames
/**
* returns array of partition names for a specific db/table
*
* @access public
* @uses PMA_DBI_fetch_result()
* @return array of partition names
*/
static public function getPartitionNames($db, $table)
{
if (PMA_Partition::havePartitioning()) {
return PMA_DBI_fetch_result("select `PARTITION_NAME` from `information_schema`.`PARTITIONS` where `TABLE_SCHEMA` = '" . $db . "' and `TABLE_NAME` = '" . $table . "'");
} else {
return array();
}
}
示例5: PMA_Bookmark_getList
/**
* Gets the list of bookmarks defined for the current database
*
* @uses PMA_backquote()
* @uses PMA_sqlAddslashes()
* @uses PMA_DBI_fetch_result()
* @uses PMA_DBI_QUERY_STORE
* @uses PMA_Bookmark_getParams()
* @global resource the controluser db connection handle
*
* @param string the current database name
*
* @return array the bookmarks list (key as index, label as value)
*
* @access public
*/
function PMA_Bookmark_getList($db)
{
global $controllink;
$cfgBookmark = PMA_Bookmark_getParams();
if (empty($cfgBookmark)) {
return array();
}
$query = 'SELECT label, id FROM ' . PMA_backquote($cfgBookmark['db']) . '.' . PMA_backquote($cfgBookmark['table']) . ' WHERE dbase = \'' . PMA_sqlAddslashes($db) . '\'' . ' AND (user = \'' . PMA_sqlAddslashes($cfgBookmark['user']) . '\'' . ' OR user = \'\')' . ' ORDER BY label';
return PMA_DBI_fetch_result($query, 'id', 'label', $controllink, PMA_DBI_QUERY_STORE);
}
示例6: getStorageEngines
/**
* returns array of storage engines
*
* @static
* @staticvar array $storage_engines storage engines
* @access public
* @return array of storage engines
*/
public static function getStorageEngines()
{
static $storage_engines = null;
if (null == $storage_engines) {
if (PMA_DRIZZLE) {
$sql = "SELECT\n p.plugin_name AS Engine,\n (CASE\n WHEN p.plugin_name = @@storage_engine THEN 'DEFAULT'\n WHEN p.is_active THEN 'YES'\n ELSE 'DISABLED' END) AS Support,\n m.module_description AS Comment\n FROM data_dictionary.plugins p\n JOIN data_dictionary.modules m USING (module_name)\n WHERE p.plugin_type = 'StorageEngine'\n AND p.plugin_name NOT IN ('FunctionEngine', 'schema')";
$storage_engines = PMA_DBI_fetch_result($sql, 'Engine');
} else {
$storage_engines = PMA_DBI_fetch_result('SHOW STORAGE ENGINES', 'Engine');
}
}
return $storage_engines;
}
示例7: getStorageEngines
/**
* returns array of storage engines
*
* @static
* @staticvar array $storage_engines storage engines
* @access public
* @uses PMA_MYSQL_INT_VERSION
* @uses PMA_StorageEngine::getStorageEnginesBefore40102()
* @uses PMA_DBI_fetch_result()
* @return array of storage engines
*/
function getStorageEngines()
{
static $storage_engines = null;
if (null !== $storage_engines) {
return $storage_engines;
}
$storage_engines = array();
// SHOW STORAGE ENGINES comes with MySQL 4.1.2
if (PMA_MYSQL_INT_VERSION < 40102) {
$storage_engines = PMA_StorageEngine::getStorageEnginesBefore40102();
} else {
$storage_engines = PMA_DBI_fetch_result('SHOW STORAGE ENGINES', 'Engine');
}
return $storage_engines;
}
示例8: PMA_Bookmark_getList
/**
* Gets the list of bookmarks defined for the current database
*
* @uses PMA_backquote()
* @uses PMA_sqlAddslashes()
* @uses PMA_DBI_fetch_result()
* @uses PMA_DBI_QUERY_STORE
* @uses PMA_Bookmark_getParams()
* @global resource the controluser db connection handle
*
* @param string the current database name
*
* @return array the bookmarks list (key as index, label as value)
*
* @access public
*/
function PMA_Bookmark_getList($db)
{
global $controllink;
$cfgBookmark = PMA_Bookmark_getParams();
if (empty($cfgBookmark)) {
return array();
}
$query = 'SELECT label, id FROM ' . PMA_backquote($cfgBookmark['db']) . '.' . PMA_backquote($cfgBookmark['table']) . ' WHERE dbase = \'' . PMA_sqlAddslashes($db) . '\'' . ' AND user = \'' . PMA_sqlAddslashes($cfgBookmark['user']) . '\'' . ' ORDER BY label';
$per_user = PMA_DBI_fetch_result($query, 'id', 'label', $controllink, PMA_DBI_QUERY_STORE);
$query = 'SELECT label, id FROM ' . PMA_backquote($cfgBookmark['db']) . '.' . PMA_backquote($cfgBookmark['table']) . ' WHERE dbase = \'' . PMA_sqlAddslashes($db) . '\'' . ' AND user = \'\'' . ' ORDER BY label';
$global = PMA_DBI_fetch_result($query, 'id', 'label', $controllink, PMA_DBI_QUERY_STORE);
foreach ($global as $key => $val) {
$global[$key] = $val . ' (' . __('shared') . ')';
}
$ret = $global + $per_user;
asort($ret);
return $ret;
}
示例9: getPageBufferpool
/**
* returns html tables with stats over inno db buffer pool
*
* @uses PMA_DBI_fetch_result()
* @uses PMA_formatNumber()
* @uses PMA_formatByteDown()
* @uses join()
* @uses htmlspecialchars()
* @uses PMA_formatNumber()
* @return string html table with stats
*/
function getPageBufferpool()
{
// The following query is only possible because we know
// that we are on MySQL 5 here (checked above)!
// side note: I love MySQL 5 for this. :-)
$sql = '
SHOW STATUS
WHERE Variable_name LIKE \'Innodb\\_buffer\\_pool\\_%\'
OR Variable_name = \'Innodb_page_size\';';
$status = PMA_DBI_fetch_result($sql, 0, 1);
$output = '<table class="data" id="table_innodb_bufferpool_usage">' . "\n" . ' <caption class="tblHeaders">' . "\n" . ' ' . __('Buffer Pool Usage') . "\n" . ' </caption>' . "\n" . ' <tfoot>' . "\n" . ' <tr>' . "\n" . ' <th colspan="2">' . "\n" . ' ' . __('Total') . "\n" . ' : ' . PMA_formatNumber($status['Innodb_buffer_pool_pages_total'], 0) . ' ' . __('pages') . ' / ' . join(' ', PMA_formatByteDown($status['Innodb_buffer_pool_pages_total'] * $status['Innodb_page_size'])) . "\n" . ' </th>' . "\n" . ' </tr>' . "\n" . ' </tfoot>' . "\n" . ' <tbody>' . "\n" . ' <tr class="odd">' . "\n" . ' <th>' . __('Free pages') . '</th>' . "\n" . ' <td class="value">' . PMA_formatNumber($status['Innodb_buffer_pool_pages_free'], 0) . '</td>' . "\n" . ' </tr>' . "\n" . ' <tr class="even">' . "\n" . ' <th>' . __('Dirty pages') . '</th>' . "\n" . ' <td class="value">' . PMA_formatNumber($status['Innodb_buffer_pool_pages_dirty'], 0) . '</td>' . "\n" . ' </tr>' . "\n" . ' <tr class="odd">' . "\n" . ' <th>' . __('Pages containing data') . '</th>' . "\n" . ' <td class="value">' . PMA_formatNumber($status['Innodb_buffer_pool_pages_data'], 0) . "\n" . '</td>' . "\n" . ' </tr>' . "\n" . ' <tr class="even">' . "\n" . ' <th>' . __('Pages to be flushed') . '</th>' . "\n" . ' <td class="value">' . PMA_formatNumber($status['Innodb_buffer_pool_pages_flushed'], 0) . "\n" . '</td>' . "\n" . ' </tr>' . "\n" . ' <tr class="odd">' . "\n" . ' <th>' . __('Busy pages') . '</th>' . "\n" . ' <td class="value">' . PMA_formatNumber($status['Innodb_buffer_pool_pages_misc'], 0) . "\n" . '</td>' . "\n" . ' </tr>';
// not present at least since MySQL 5.1.40
if (isset($status['Innodb_buffer_pool_pages_latched'])) {
$output .= ' <tr class="even">' . ' <th>' . __('Latched pages') . '</th>' . ' <td class="value">' . PMA_formatNumber($status['Innodb_buffer_pool_pages_latched'], 0) . '</td>' . ' </tr>';
}
$output .= ' </tbody>' . "\n" . '</table>' . "\n\n" . '<table class="data" id="table_innodb_bufferpool_activity">' . "\n" . ' <caption class="tblHeaders">' . "\n" . ' ' . __('Buffer Pool Activity') . "\n" . ' </caption>' . "\n" . ' <tbody>' . "\n" . ' <tr class="odd">' . "\n" . ' <th>' . __('Read requests') . '</th>' . "\n" . ' <td class="value">' . PMA_formatNumber($status['Innodb_buffer_pool_read_requests'], 0) . "\n" . '</td>' . "\n" . ' </tr>' . "\n" . ' <tr class="even">' . "\n" . ' <th>' . __('Write requests') . '</th>' . "\n" . ' <td class="value">' . PMA_formatNumber($status['Innodb_buffer_pool_write_requests'], 0) . "\n" . '</td>' . "\n" . ' </tr>' . "\n" . ' <tr class="odd">' . "\n" . ' <th>' . __('Read misses') . '</th>' . "\n" . ' <td class="value">' . PMA_formatNumber($status['Innodb_buffer_pool_reads'], 0) . "\n" . '</td>' . "\n" . ' </tr>' . "\n" . ' <tr class="even">' . "\n" . ' <th>' . __('Write waits') . '</th>' . "\n" . ' <td class="value">' . PMA_formatNumber($status['Innodb_buffer_pool_wait_free'], 0) . "\n" . '</td>' . "\n" . ' </tr>' . "\n" . ' <tr class="odd">' . "\n" . ' <th>' . __('Read misses in %') . '</th>' . "\n" . ' <td class="value">' . ($status['Innodb_buffer_pool_read_requests'] == 0 ? '---' : htmlspecialchars(PMA_formatNumber($status['Innodb_buffer_pool_reads'] * 100 / $status['Innodb_buffer_pool_read_requests'], 3, 2)) . ' %') . "\n" . '</td>' . "\n" . ' </tr>' . "\n" . ' <tr class="even">' . "\n" . ' <th>' . __('Write waits in %') . '</th>' . "\n" . ' <td class="value">' . ($status['Innodb_buffer_pool_write_requests'] == 0 ? '---' : htmlspecialchars(PMA_formatNumber($status['Innodb_buffer_pool_wait_free'] * 100 / $status['Innodb_buffer_pool_write_requests'], 3, 2)) . ' %') . "\n" . '</td>' . "\n" . ' </tr>' . "\n" . ' </tbody>' . "\n" . '</table>' . "\n";
return $output;
}
示例10: run
function run()
{
// HowTo: A simple Advisory system in 3 easy steps.
// Step 1: Get some variables to evaluate on
$this->variables = array_merge(PMA_DBI_fetch_result('SHOW GLOBAL STATUS', 0, 1), PMA_DBI_fetch_result('SHOW GLOBAL VARIABLES', 0, 1));
if (PMA_DRIZZLE) {
$this->variables = array_merge($this->variables, PMA_DBI_fetch_result("SELECT concat('Com_', variable_name), variable_value\n FROM data_dictionary.GLOBAL_STATEMENTS", 0, 1));
}
// Add total memory to variables as well
include_once 'libraries/sysinfo.lib.php';
$sysinfo = PMA_getSysInfo();
$memory = $sysinfo->memory();
$this->variables['system_memory'] = $memory['MemTotal'];
// Step 2: Read and parse the list of rules
$this->parseResult = $this->parseRulesFile();
// Step 3: Feed the variables to the rules and let them fire. Sets $runResult
$this->runRules();
return array('parse' => array('errors' => $this->parseResult['errors']), 'run' => $this->runResult);
}
示例11: PMA_EVN_main
/**
* Main function for the events functionality
*/
function PMA_EVN_main()
{
global $db;
PMA_EVN_setGlobals();
/**
* Process all requests
*/
PMA_EVN_handleEditor();
PMA_EVN_handleExport();
/**
* Display a list of available events
*/
$columns = "`EVENT_NAME`, `EVENT_TYPE`, `STATUS`";
$where = "EVENT_SCHEMA='" . PMA_sqlAddSlashes($db) . "'";
$query = "SELECT {$columns} FROM `INFORMATION_SCHEMA`.`EVENTS` " . "WHERE {$where} ORDER BY `EVENT_NAME` ASC;";
$items = PMA_DBI_fetch_result($query);
echo PMA_RTE_getList('event', $items);
/**
* Display a link for adding a new event, if
* the user has the privileges and a link to
* toggle the state of the event scheduler.
*/
echo PMA_EVN_getFooterLinks();
}
示例12: PMA_generate_common_url
* a db, in which case we want to keep displaying the tabs of
* the Database panel
*/
if (empty($viewing_mode)) {
$db = $table = '';
}
/**
* Set parameters for links
*/
$url_query = PMA_generate_common_url($db);
/**
* Defines the urls to return to in case of error in a sql statement
*/
$err_url = 'main.php' . $url_query;
/**
* Displays the headers
*/
require_once './libraries/header.inc.php';
/**
* @global boolean Checks for superuser privileges
*/
$is_superuser = PMA_isSuperuser();
// now, select the mysql db
if ($is_superuser) {
PMA_DBI_select_db('mysql', $userlink);
}
/**
* @global array binary log files
*/
$binary_logs = PMA_DBI_fetch_result('SHOW MASTER LOGS', 'Log_name', null, null, PMA_DBI_QUERY_STORE);
示例13: getFunctionsClass
/**
* Returns array of functions available for a class.
*
* @param string $class The class to get function list.
*
* @return array
*
*/
public function getFunctionsClass($class)
{
switch ($class) {
case 'CHAR':
$ret = array('BIN', 'CHAR', 'CURRENT_USER', 'COMPRESS', 'DATABASE', 'DAYNAME', 'HEX', 'LOAD_FILE', 'LOWER', 'LTRIM', 'MD5', 'MONTHNAME', 'QUOTE', 'REVERSE', 'RTRIM', 'SCHEMA', 'SPACE', 'TRIM', 'UNCOMPRESS', 'UNHEX', 'UPPER', 'USER', 'UUID', 'VERSION');
// check for some functions known to be in modules
$functions = array('MYSQL_PASSWORD', 'ROT13');
// add new functions
$sql = "SELECT upper(plugin_name) f\n FROM data_dictionary.plugins\n WHERE plugin_name IN ('" . implode("','", $functions) . "')\n AND plugin_type = 'Function'\n AND is_active";
$drizzle_functions = PMA_DBI_fetch_result($sql, 'f', 'f');
if (count($drizzle_functions) > 0) {
$ret = array_merge($ret, $drizzle_functions);
sort($ret);
}
return $ret;
case 'UUID':
return array('UUID');
case 'DATE':
return array('CURRENT_DATE', 'CURRENT_TIME', 'DATE', 'FROM_DAYS', 'FROM_UNIXTIME', 'LAST_DAY', 'NOW', 'SYSDATE', 'TIMESTAMP', 'UTC_DATE', 'UTC_TIME', 'UTC_TIMESTAMP', 'YEAR');
case 'NUMBER':
return array('ABS', 'ACOS', 'ASCII', 'ASIN', 'ATAN', 'BIT_COUNT', 'CEILING', 'CHAR_LENGTH', 'CONNECTION_ID', 'COS', 'COT', 'CRC32', 'DAYOFMONTH', 'DAYOFWEEK', 'DAYOFYEAR', 'DEGREES', 'EXP', 'FLOOR', 'HOUR', 'LENGTH', 'LN', 'LOG', 'LOG2', 'LOG10', 'MICROSECOND', 'MINUTE', 'MONTH', 'OCT', 'ORD', 'PI', 'QUARTER', 'RADIANS', 'RAND', 'ROUND', 'SECOND', 'SIGN', 'SIN', 'SQRT', 'TAN', 'TO_DAYS', 'TIME_TO_SEC', 'UNCOMPRESSED_LENGTH', 'UNIX_TIMESTAMP', 'WEEKDAY', 'WEEKOFYEAR', 'YEARWEEK');
}
return array();
}
示例14: getIndexedColumns
/**
* Get all indexed columns
*
* returns an array with all columns make use of an index, in fact only
* first columns in an index
*
* f.e. index(col1, col2) would only return col1
* @param boolean whether to quote name with backticks ``
* @return array
*/
public function getIndexedColumns($backquoted = true)
{
$sql = 'SHOW INDEX FROM ' . $this->getFullName(true) . ' WHERE Seq_in_index = 1';
$indexed = PMA_DBI_fetch_result($sql, 'Column_name', 'Column_name');
$return = array();
foreach ($indexed as $column) {
$return[] = $this->getFullName($backquoted) . '.' . ($backquoted ? PMA_backquote($column) : $column);
}
return $return;
}
示例15: PMA_DBI_fetch_result
* function. This needs further reseach because a procedure
* does not necessarily contain a SELECT statement that
* produces something to see. But it seems we could at least
* get the number of rows affected. We would have to
* use the CLIENT_MULTI_RESULTS flag to get the result set
* and also the call status. All this does not fit well with
* our current sql.php.
* Of course the interface would need a way to pass calling parameters.
* Also, support DEFINER (like we do in export).
* @version $Id$
* @package phpMyAdmin
*/
if (!defined('PHPMYADMIN')) {
exit;
}
$routines = PMA_DBI_fetch_result('SELECT SPECIFIC_NAME,ROUTINE_NAME,ROUTINE_TYPE,DTD_IDENTIFIER FROM information_schema.ROUTINES WHERE ROUTINE_SCHEMA= \'' . PMA_sqlAddslashes($db, true) . '\';');
if ($routines) {
PMA_generate_slider_effect('routines', $strRoutines);
echo '<fieldset>' . "\n";
echo ' <legend>' . $strRoutines . '</legend>' . "\n";
echo '<table border="0">';
echo sprintf('<tr>
<th>%s</th>
<th> </th>
<th> </th>
<th>%s</th>
<th>%s</th>
</tr>', $strName, $strType, $strRoutineReturnType);
$ct = 0;
$delimiter = '//';
foreach ($routines as $routine) {