PMA\libraries\dbi\DBIExtension::realQuery PHP Method

realQuery() public method

runs a query and returns the result
public realQuery ( string $query, resource $link, integer $options ) : mixed
$query string query to execute
$link resource connection object
$options integer query options
return mixed result
    public function realQuery($query, $link, $options);

Usage Example

コード例 #1
0
 /**
  * runs a query and returns the result
  *
  * @param string  $query               query to run
  * @param object  $link                mysql link resource
  * @param integer $options             query options
  * @param bool    $cache_affected_rows whether to cache affected row
  *
  * @return mixed
  */
 public function tryQuery($query, $link = null, $options = 0, $cache_affected_rows = true)
 {
     $debug = $GLOBALS['cfg']['DBG']['sql'];
     $link = $this->getLink($link);
     if ($link === false) {
         return false;
     }
     if ($debug) {
         $time = microtime(true);
     }
     $result = $this->_extension->realQuery($query, $link, $options);
     if ($cache_affected_rows) {
         $GLOBALS['cached_affected_rows'] = $this->affectedRows($link, false);
     }
     if ($debug) {
         $time = microtime(true) - $time;
         $this->_dbgQuery($query, $link, $result, $time);
         if ($GLOBALS['cfg']['DBG']['sqllog']) {
             openlog('phpMyAdmin', LOG_NDELAY | LOG_PID, LOG_USER);
             syslog(LOG_INFO, 'SQL[' . basename($_SERVER['SCRIPT_NAME']) . ']: ' . sprintf('%0.3f', $time) . ' > ' . $query);
         }
     }
     if (!empty($result) && Tracker::isActive()) {
         Tracker::handleQuery($query);
     }
     return $result;
 }
All Usage Examples Of PMA\libraries\dbi\DBIExtension::realQuery