当前位置: 首页>>代码示例>>PHP>>正文


PHP PMA_DBI_try_query函数代码示例

本文整理汇总了PHP中PMA_DBI_try_query函数的典型用法代码示例。如果您正苦于以下问题:PHP PMA_DBI_try_query函数的具体用法?PHP PMA_DBI_try_query怎么用?PHP PMA_DBI_try_query使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了PMA_DBI_try_query函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: PMA_DBI_get_dblist

function PMA_DBI_get_dblist($link = NULL)
{
    if (empty($link)) {
        if (isset($GLOBALS['userlink'])) {
            $link = $GLOBALS['userlink'];
        } else {
            return FALSE;
        }
    }
    $res = PMA_DBI_try_query('SHOW DATABASES;', $link);
    $dbs_array = array();
    while ($row = PMA_DBI_fetch_row($res)) {
        // Before MySQL 4.0.2, SHOW DATABASES could send the
        // whole list, so check if we really have access:
        //if (PMA_MYSQL_CLIENT_API < 40002) {
        // Better check the server version, in case the client API
        // is more recent than the server version
        if (PMA_MYSQL_INT_VERSION < 40002) {
            $dblink = @PMA_DBI_select_db($row[0], $link);
            if (!$dblink) {
                continue;
            }
        }
        $dbs_array[] = $row[0];
    }
    PMA_DBI_free_result($res);
    unset($res);
    return $dbs_array;
}
开发者ID:BackupTheBerlios,项目名称:smileinstaller,代码行数:29,代码来源:database_interface.lib.php

示例2: setProperties

 /**
  * Sets the import plugin properties.
  * Called in the constructor.
  *
  * @return void
  */
 protected function setProperties()
 {
     if ($GLOBALS['cfg']['Import']['ldi_local_option'] == 'auto') {
         $GLOBALS['cfg']['Import']['ldi_local_option'] = false;
         $result = PMA_DBI_try_query('SHOW VARIABLES LIKE \'local\\_infile\';');
         if ($result != false && PMA_DBI_num_rows($result) > 0) {
             $tmp = PMA_DBI_fetch_row($result);
             if ($tmp[1] == 'ON') {
                 $GLOBALS['cfg']['Import']['ldi_local_option'] = true;
             }
         }
         PMA_DBI_free_result($result);
         unset($result);
     }
     $generalOptions = parent::setProperties();
     $this->properties->setText('CSV using LOAD DATA');
     $this->properties->setExtension('ldi');
     $leaf = new TextPropertyItem();
     $leaf->setName("columns");
     $leaf->setText(__('Column names: '));
     $generalOptions->addProperty($leaf);
     $leaf = new BoolPropertyItem();
     $leaf->setName("ignore");
     $leaf->setText(__('Do not abort on INSERT error'));
     $generalOptions->addProperty($leaf);
     $leaf = new BoolPropertyItem();
     $leaf->setName("local_option");
     $leaf->setText(__('Use LOCAL keyword'));
     $generalOptions->addProperty($leaf);
 }
开发者ID:AmberWish,项目名称:laba_web,代码行数:36,代码来源:ImportLdi.class.php

示例3: PMA_analyseShowGrant

function PMA_analyseShowGrant($rs_usr, &$is_create_priv, &$db_to_create, &$is_reload_priv)
{
    $re0 = '(^|(\\\\\\\\)+|[^\\])';
    // non-escaped wildcards
    $re1 = '(^|[^\\])(\\\\)+';
    // escaped wildcards
    while ($row = PMA_DBI_fetch_row($rs_usr)) {
        $show_grants_dbname = substr($row[0], strpos($row[0], ' ON ') + 4, strpos($row[0], '.', strpos($row[0], ' ON ')) - strpos($row[0], ' ON ') - 4);
        $show_grants_dbname = ereg_replace('^`(.*)`', '\\1', $show_grants_dbname);
        $show_grants_str = substr($row[0], 6, strpos($row[0], ' ON ') - 6);
        if ($show_grants_str == 'ALL' || $show_grants_str == 'ALL PRIVILEGES' || $show_grants_str == 'CREATE' || strpos($show_grants_str, 'CREATE')) {
            if ($show_grants_dbname == '*') {
                $is_create_priv = TRUE;
                $is_reload_priv = TRUE;
                $db_to_create = '';
                break;
            } else {
                if (ereg($re0 . '%|_', $show_grants_dbname) && !ereg('\\\\%|\\\\_', $show_grants_dbname) || !PMA_DBI_try_query('USE ' . ereg_replace($re1 . '(%|_)', '\\1\\3', $show_grants_dbname)) && substr(PMA_DBI_getError(), 1, 4) != 1044) {
                    $db_to_create = ereg_replace($re0 . '%', '\\1...', ereg_replace($re0 . '_', '\\1?', $show_grants_dbname));
                    $db_to_create = ereg_replace($re1 . '(%|_)', '\\1\\3', $db_to_create);
                    $is_create_priv = TRUE;
                    break;
                }
            }
            // end elseif
        }
        // end if
    }
    // end while
}
开发者ID:mike503,项目名称:phpmyadmin,代码行数:30,代码来源:check_user_privileges.lib.php

示例4: PMA_getExistingTranformationData

/**
 * Get existing data on tranformations applyed for
 * columns in a particular table
 *
 * @param string $db Database name looking for
 *
 * @return mysqli_result Result of executed SQL query
 */
function PMA_getExistingTranformationData($db)
{
    $cfgRelation = PMA_getRelationsParam();
    // Get the existing transformation details of the same database
    // from pma_column_info table
    $pma_transformation_sql = 'SELECT * FROM ' . PMA_Util::backquote($cfgRelation['db']) . '.' . PMA_Util::backquote($cfgRelation['column_info']) . ' WHERE `db_name` = \'' . PMA_Util::sqlAddSlashes($db) . '\'';
    return PMA_DBI_try_query($pma_transformation_sql);
}
开发者ID:nhodges,项目名称:phpmyadmin,代码行数:16,代码来源:tbl_views.lib.php

示例5: PMA_analyseShowGrant

function PMA_analyseShowGrant($rs_usr, &$is_create_db_priv, &$db_to_create, &$is_reload_priv, &$dbs_where_create_table_allowed)
{
    $re0 = '(^|(\\\\\\\\)+|[^\\])';
    // non-escaped wildcards
    $re1 = '(^|[^\\])(\\\\)+';
    // escaped wildcards
    while ($row = PMA_DBI_fetch_row($rs_usr)) {
        $show_grants_dbname = substr($row[0], strpos($row[0], ' ON ') + 4, strpos($row[0], '.', strpos($row[0], ' ON ')) - strpos($row[0], ' ON ') - 4);
        $show_grants_dbname = ereg_replace('^`(.*)`', '\\1', $show_grants_dbname);
        $show_grants_str = substr($row[0], 6, strpos($row[0], ' ON ') - 6);
        if ($show_grants_str == 'RELOAD') {
            $is_reload_priv = true;
        }
        /**
         * @todo if we find CREATE VIEW but not CREATE, do not offer  
         * the create database dialog box
         */
        if ($show_grants_str == 'ALL' || $show_grants_str == 'ALL PRIVILEGES' || $show_grants_str == 'CREATE' || strpos($show_grants_str, 'CREATE,') !== false) {
            if ($show_grants_dbname == '*') {
                // a global CREATE privilege
                $is_create_db_priv = true;
                $is_reload_priv = true;
                $db_to_create = '';
                $dbs_where_create_table_allowed[] = '*';
                break;
            } else {
                // this array may contain wildcards
                $dbs_where_create_table_allowed[] = $show_grants_dbname;
                // before MySQL 4.1.0, we cannot use backquotes around a dbname
                // for the USE command, so the USE will fail if the dbname contains
                // a "-" and we cannot detect if such a db already exists;
                // since 4.1.0, we need to use backquotes if the dbname contains a "-"
                // in a USE command
                if (PMA_MYSQL_INT_VERSION > 40100) {
                    $dbname_to_test = PMA_backquote($show_grants_dbname);
                } else {
                    $dbname_to_test = $show_grants_dbname;
                }
                if (ereg($re0 . '%|_', $show_grants_dbname) && !ereg('\\\\%|\\\\_', $show_grants_dbname) || !PMA_DBI_try_query('USE ' . ereg_replace($re1 . '(%|_)', '\\1\\3', $dbname_to_test), null, PMA_DBI_QUERY_STORE) && substr(PMA_DBI_getError(), 1, 4) != 1044) {
                    $db_to_create = ereg_replace($re0 . '%', '\\1...', ereg_replace($re0 . '_', '\\1?', $show_grants_dbname));
                    $db_to_create = ereg_replace($re1 . '(%|_)', '\\1\\3', $db_to_create);
                    $is_create_db_priv = true;
                    /**
                     * @todo collect $db_to_create into an array, to display a
                     * drop-down in the "Create new database" dialog
                     */
                    // we don't break, we want all possible databases
                    //break;
                }
                // end if
            }
            // end elseif
        }
        // end if
    }
    // end while
}
开发者ID:Kishaaa,项目名称:cs160-website,代码行数:57,代码来源:check_user_privileges.lib.php

示例6: PMA_query_as_cu

/**
 * Executes a query as controluser if possible, otherwise as normal user
 *
 * @param   string    the query to execute
 * @param   boolean   whether to display SQL error messages or not
 *
 * @return  integer   the result set, or false if no result set
 *
 * @access  public
 *
 * @author  Mike Beck <mikebeck@users.sourceforge.net>
 */
function PMA_query_as_cu($sql, $show_error = true, $options = 0)
{
    if ($show_error) {
        $result = PMA_DBI_query($sql, $GLOBALS['controllink'], $options);
    } else {
        $result = @PMA_DBI_try_query($sql, $GLOBALS['controllink'], $options);
    } // end if... else...

    if ($result) {
        return $result;
    } else {
        return false;
    }
} // end of the "PMA_query_as_cu()" function
开发者ID:blumenbach,项目名称:blumenbach-online.de,代码行数:26,代码来源:relation.lib.php

示例7: PMA_query_as_cu

/**
 * Executes a query as controluser if possible, otherwise as normal user
 *
 * @param   string    the query to execute
 * @param   boolean   whether to display SQL error messages or not
 *
 * @return  integer   the result id
 *
 * @global  string    the URL of the page to show in case of error
 * @global  string    the name of db to come back to
 * @global  resource  the resource id of DB connect as controluser
 * @global  array     configuration infos about the relations stuff
 *
 * @access  public
 *
 * @author  Mike Beck <mikebeck@users.sourceforge.net>
 */
function PMA_query_as_cu($sql, $show_error = TRUE, $options = 0)
{
    global $err_url_0, $db, $dbh, $cfgRelation;
    PMA_DBI_select_db($cfgRelation['db'], $dbh);
    if ($show_error) {
        $result = PMA_DBI_query($sql, $dbh, $options);
    } else {
        $result = @PMA_DBI_try_query($sql, $dbh, $options);
    }
    // end if... else...
    PMA_DBI_select_db($db, $dbh);
    if ($result) {
        return $result;
    } else {
        return FALSE;
    }
}
开发者ID:lifecom,项目名称:test,代码行数:34,代码来源:relation.lib.php

示例8: PMA_query_as_controluser

/**
 * Executes a query as controluser if possible, otherwise as normal user
 *
 * @param string  $sql        the query to execute
 * @param boolean $show_error whether to display SQL error messages or not
 * @param int     $options    query options
 *
 * @return  integer   the result set, or false if no result set
 *
 * @access  public
 *
 */
function PMA_query_as_controluser($sql, $show_error = true, $options = 0)
{
    // Avoid caching of the number of rows affected; for example, this function
    // is called for tracking purposes but we want to display the correct number
    // of rows affected by the original query, not by the query generated for
    // tracking.
    $cache_affected_rows = false;
    if ($show_error) {
        $result = PMA_DBI_query($sql, $GLOBALS['controllink'], $options, $cache_affected_rows);
    } else {
        $result = @PMA_DBI_try_query($sql, $GLOBALS['controllink'], $options, $cache_affected_rows);
    }
    // end if... else...
    if ($result) {
        return $result;
    } else {
        return false;
    }
}
开发者ID:AmberWish,项目名称:laba_web,代码行数:31,代码来源:relation.lib.php

示例9: setProperties

 /**
  * Sets the import plugin properties.
  * Called in the constructor.
  *
  * @return void
  */
 protected function setProperties()
 {
     if ($GLOBALS['cfg']['Import']['ldi_local_option'] == 'auto') {
         $GLOBALS['cfg']['Import']['ldi_local_option'] = false;
         $result = PMA_DBI_try_query('SHOW VARIABLES LIKE \'local\\_infile\';');
         if ($result != false && PMA_DBI_num_rows($result) > 0) {
             $tmp = PMA_DBI_fetch_row($result);
             if ($tmp[1] == 'ON') {
                 $GLOBALS['cfg']['Import']['ldi_local_option'] = true;
             }
         }
         PMA_DBI_free_result($result);
         unset($result);
     }
     $props = 'libraries/properties/';
     include_once "{$props}/plugins/ImportPluginProperties.class.php";
     include_once "{$props}/options/groups/OptionsPropertyRootGroup.class.php";
     include_once "{$props}/options/groups/OptionsPropertyMainGroup.class.php";
     include_once "{$props}/options/items/BoolPropertyItem.class.php";
     include_once "{$props}/options/items/TextPropertyItem.class.php";
     $importPluginProperties = new ImportPluginProperties();
     $importPluginProperties->setText('CSV using LOAD DATA');
     $importPluginProperties->setExtension('ldi');
     $importPluginProperties->setOptionsText(__('Options'));
     // create the root group that will be the options field for
     // $importPluginProperties
     // this will be shown as "Format specific options"
     $importSpecificOptions = new OptionsPropertyRootGroup();
     $importSpecificOptions->setName("Format Specific Options");
     // general options main group
     $generalOptions = new OptionsPropertyMainGroup();
     $generalOptions->setName("general_opts");
     // create primary items and add them to the group
     $leaf = new BoolPropertyItem();
     $leaf->setName("replace");
     $leaf->setText(__('Replace table data with file'));
     $generalOptions->addProperty($leaf);
     // add the main group to the root group
     $importSpecificOptions->addProperty($generalOptions);
     // set the options for the import plugin property item
     $importPluginProperties->setOptions($importSpecificOptions);
     $this->properties = $importPluginProperties;
 }
开发者ID:rajatsinghal,项目名称:phpmyadmin,代码行数:49,代码来源:ImportLdi.class.php

示例10: PMA_exportHeader

/**
 * Outputs export header
 *
 * @return  bool        Whether it suceeded
 *
 * @access  public
 */
function PMA_exportHeader()
{
    global $crlf;
    global $cfg;
    if (PMA_MYSQL_INT_VERSION >= 40100 && isset($GLOBALS['sql_compat']) && $GLOBALS['sql_compat'] != 'NONE') {
        PMA_DBI_try_query('SET SQL_MODE="' . $GLOBALS['sql_compat'] . '"');
    }
    $head = $GLOBALS['comment_marker'] . 'phpMyAdmin SQL Dump' . $crlf . $GLOBALS['comment_marker'] . 'version ' . PMA_VERSION . $crlf . $GLOBALS['comment_marker'] . 'http://www.phpmyadmin.net' . $crlf . $GLOBALS['comment_marker'] . $crlf . $GLOBALS['comment_marker'] . $GLOBALS['strHost'] . ': ' . $cfg['Server']['host'];
    if (!empty($cfg['Server']['port'])) {
        $head .= ':' . $cfg['Server']['port'];
    }
    $head .= $crlf . $GLOBALS['comment_marker'] . $GLOBALS['strGenTime'] . ': ' . PMA_localisedDate() . $crlf . $GLOBALS['comment_marker'] . $GLOBALS['strServerVersion'] . ': ' . substr(PMA_MYSQL_INT_VERSION, 0, 1) . '.' . (int) substr(PMA_MYSQL_INT_VERSION, 1, 2) . '.' . (int) substr(PMA_MYSQL_INT_VERSION, 3) . $crlf . $GLOBALS['comment_marker'] . $GLOBALS['strPHPVersion'] . ': ' . phpversion() . $crlf;
    if (isset($GLOBALS['header_comment']) && !empty($GLOBALS['header_comment'])) {
        $lines = explode('\\n', $GLOBALS['header_comment']);
        $head .= $GLOBALS['comment_marker'] . $crlf . $GLOBALS['comment_marker'] . implode($crlf . $GLOBALS['comment_marker'], $lines) . $crlf . $GLOBALS['comment_marker'] . $crlf;
    }
    if (isset($GLOBALS['disable_fk'])) {
        $head .= $crlf . 'SET FOREIGN_KEY_CHECKS=0;' . $crlf;
    }
    if (isset($GLOBALS['use_transaction'])) {
        $head .= $crlf . 'SET AUTOCOMMIT=0;' . $crlf . 'START TRANSACTION;' . $crlf . $crlf;
    }
    return PMA_exportOutputHandler($head);
}
开发者ID:BackupTheBerlios,项目名称:vhcs-svn,代码行数:31,代码来源:sql.php

示例11: getData

 /**
  * Returns the names of children of type $type present inside this container
  * This method is overridden by the Node_Database and Node_Table classes
  *
  * @param string $type         The type of item we are looking for
  *                             ('tables', 'views', etc)
  * @param int    $pos          The offset of the list within the results
  * @param string $searchClause A string used to filter the results of the query
  *
  * @return array
  */
 public function getData($type, $pos, $searchClause = '')
 {
     $maxItems = $GLOBALS['cfg']['MaxNavigationItems'];
     $retval = array();
     $db = $this->realParent()->real_name;
     $table = $this->real_name;
     switch ($type) {
         case 'columns':
             if (!$GLOBALS['cfg']['Servers'][$GLOBALS['server']]['DisableIS']) {
                 $db = PMA_Util::sqlAddSlashes($db);
                 $table = PMA_Util::sqlAddSlashes($table);
                 $query = "SELECT `COLUMN_NAME` AS `name` ";
                 $query .= "FROM `INFORMATION_SCHEMA`.`COLUMNS` ";
                 $query .= "WHERE `TABLE_NAME`='{$table}' ";
                 $query .= "AND `TABLE_SCHEMA`='{$db}' ";
                 $query .= "ORDER BY `COLUMN_NAME` ASC ";
                 $query .= "LIMIT " . intval($pos) . ", {$maxItems}";
                 $retval = PMA_DBI_fetch_result($query);
             } else {
                 $db = PMA_Util::backquote($db);
                 $table = PMA_Util::backquote($table);
                 $query = "SHOW COLUMNS FROM {$table} FROM {$db}";
                 $handle = PMA_DBI_try_query($query);
                 if ($handle !== false) {
                     $count = 0;
                     while ($arr = PMA_DBI_fetch_array($handle)) {
                         if ($pos <= 0 && $count < $maxItems) {
                             $retval[] = $arr['Field'];
                             $count++;
                         }
                         $pos--;
                     }
                 }
             }
             break;
         case 'indexes':
             $db = PMA_Util::backquote($db);
             $table = PMA_Util::backquote($table);
             $query = "SHOW INDEXES FROM {$table} FROM {$db}";
             $handle = PMA_DBI_try_query($query);
             if ($handle !== false) {
                 $count = 0;
                 while ($arr = PMA_DBI_fetch_array($handle)) {
                     if (!in_array($arr['Key_name'], $retval)) {
                         if ($pos <= 0 && $count < $maxItems) {
                             $retval[] = $arr['Key_name'];
                             $count++;
                         }
                         $pos--;
                     }
                 }
             }
             break;
         case 'triggers':
             if (!$GLOBALS['cfg']['Servers'][$GLOBALS['server']]['DisableIS']) {
                 $db = PMA_Util::sqlAddSlashes($db);
                 $table = PMA_Util::sqlAddSlashes($table);
                 $query = "SELECT `TRIGGER_NAME` AS `name` ";
                 $query .= "FROM `INFORMATION_SCHEMA`.`TRIGGERS` ";
                 $query .= "WHERE `EVENT_OBJECT_SCHEMA`='{$db}' ";
                 $query .= "AND `EVENT_OBJECT_TABLE`='{$table}' ";
                 $query .= "ORDER BY `TRIGGER_NAME` ASC ";
                 $query .= "LIMIT " . intval($pos) . ", {$maxItems}";
                 $retval = PMA_DBI_fetch_result($query);
             } else {
                 $db = PMA_Util::backquote($db);
                 $table = PMA_Util::sqlAddSlashes($table);
                 $query = "SHOW TRIGGERS FROM {$db} WHERE `Table` = '{$table}'";
                 $handle = PMA_DBI_try_query($query);
                 if ($handle !== false) {
                     $count = 0;
                     while ($arr = PMA_DBI_fetch_array($handle)) {
                         if ($pos <= 0 && $count < $maxItems) {
                             $retval[] = $arr['Trigger'];
                             $count++;
                         }
                         $pos--;
                     }
                 }
             }
             break;
         default:
             break;
     }
     return $retval;
 }
开发者ID:GDantas05,项目名称:WorkSeries,代码行数:97,代码来源:Node_Table.class.php

示例12: PMA_displayTableBody


//.........这里部分代码省略.........
            if ($meta->numeric == 1) {
                // lem9: if two fields have the same name (this is possible
                //       with self-join queries, for example), using $meta->name
                //       will show both fields NULL even if only one is NULL,
                //       so use the $pointer
                //      (works only if function_exists('is_null')
                // PS:   why not always work with the number ($i), since
                //       the default second parameter of
                //       mysql_fetch_array() is MYSQL_BOTH, so we always get
                //       associative and numeric indices?
                //if (!isset($row[$meta->name])
                if (!isset($row[$i]) || is_null($row[$i])) {
                    $vertical_display['data'][$row_no][$i] = '    <td align="right"' . $mouse_events . ' class="' . $class . ($condition_field ? ' condition' : '') . '"><i>NULL</i></td>' . "\n";
                } elseif ($row[$i] != '') {
                    $vertical_display['data'][$row_no][$i] = '    <td align="right"' . $mouse_events . ' class="' . $class . ($condition_field ? ' condition' : '') . ' nowrap">';
                    if (isset($analyzed_sql[0]['select_expr']) && is_array($analyzed_sql[0]['select_expr'])) {
                        foreach ($analyzed_sql[0]['select_expr'] as $select_expr_position => $select_expr) {
                            $alias = $analyzed_sql[0]['select_expr'][$select_expr_position]['alias'];
                            if (isset($alias) && strlen($alias)) {
                                $true_column = $analyzed_sql[0]['select_expr'][$select_expr_position]['column'];
                                if ($alias == $meta->name) {
                                    $meta->name = $true_column;
                                }
                                // end if
                            }
                            // end if
                        }
                        // end while
                    }
                    if (isset($map[$meta->name])) {
                        // Field to display from the foreign table?
                        if (isset($map[$meta->name][2]) && strlen($map[$meta->name][2])) {
                            $dispsql = 'SELECT ' . PMA_backquote($map[$meta->name][2]) . ' FROM ' . PMA_backquote($map[$meta->name][3]) . '.' . PMA_backquote($map[$meta->name][0]) . ' WHERE ' . PMA_backquote($map[$meta->name][1]) . ' = ' . $row[$i];
                            $dispresult = PMA_DBI_try_query($dispsql, null, PMA_DBI_QUERY_STORE);
                            if ($dispresult && PMA_DBI_num_rows($dispresult) > 0) {
                                list($dispval) = PMA_DBI_fetch_row($dispresult, 0);
                            } else {
                                $dispval = $GLOBALS['strLinkNotFound'];
                            }
                            @PMA_DBI_free_result($dispresult);
                        } else {
                            $dispval = '';
                        }
                        // end if... else...
                        if (isset($GLOBALS['printview']) && $GLOBALS['printview'] == '1') {
                            $vertical_display['data'][$row_no][$i] .= ($transform_function != $default_function ? $transform_function($row[$i], $transform_options, $meta) : $transform_function($row[$i], array(), $meta)) . ' <code>[-&gt;' . $dispval . ']</code>';
                        } else {
                            $title = !empty($dispval) ? ' title="' . htmlspecialchars($dispval) . '"' : '';
                            $vertical_display['data'][$row_no][$i] .= '<a href="sql.php?' . PMA_generate_common_url($map[$meta->name][3], $map[$meta->name][0]) . '&amp;pos=0&amp;session_max_rows=' . $session_max_rows . '&amp;dontlimitchars=' . $dontlimitchars . '&amp;sql_query=' . urlencode('SELECT * FROM ' . PMA_backquote($map[$meta->name][0]) . ' WHERE ' . PMA_backquote($map[$meta->name][1]) . ' = ' . $row[$i]) . '"' . $title . '>' . ($transform_function != $default_function ? $transform_function($row[$i], $transform_options, $meta) : $transform_function($row[$i], array(), $meta)) . '</a>';
                        }
                    } else {
                        $vertical_display['data'][$row_no][$i] .= $transform_function != $default_function ? $transform_function($row[$i], $transform_options, $meta) : $transform_function($row[$i], array(), $meta);
                    }
                    $vertical_display['data'][$row_no][$i] .= '</td>' . "\n";
                } else {
                    $vertical_display['data'][$row_no][$i] = '    <td align="right"' . $mouse_events . ' class="' . $class . ' nowrap' . ($condition_field ? ' condition' : '') . '">&nbsp;</td>' . "\n";
                }
                //  b l o b
            } elseif ($GLOBALS['cfg']['ShowBlob'] == false && stristr($meta->type, 'BLOB')) {
                // loic1 : PMA_mysql_fetch_fields returns BLOB in place of
                // TEXT fields type, however TEXT fields must be displayed
                // even if $GLOBALS['cfg']['ShowBlob'] is false -> get the true type
                // of the fields.
                $field_flags = PMA_DBI_field_flags($dt_result, $i);
                if (stristr($field_flags, 'BINARY')) {
                    $blobtext = '[BLOB';
开发者ID:a195474368,项目名称:ejiawang,代码行数:67,代码来源:display_tbl.lib.php

示例13: PMA_generate_common_url

 */
$url_query = PMA_generate_common_url(isset($db) ? $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';
/**
 * Checks for superuser privileges
 */
$is_superuser = PMA_isSuperuser();
// now, select the mysql db
if ($is_superuser) {
    PMA_DBI_select_db('mysql', $userlink);
}
$has_binlogs = FALSE;
$binlogs = PMA_DBI_try_query('SHOW MASTER LOGS', null, PMA_DBI_QUERY_STORE);
if ($binlogs) {
    if (PMA_DBI_num_rows($binlogs) > 0) {
        $binary_logs = array();
        while ($row = PMA_DBI_fetch_array($binlogs)) {
            $binary_logs[] = $row[0];
        }
        $has_binlogs = TRUE;
    }
    PMA_DBI_free_result($binlogs);
}
unset($binlogs);
开发者ID:robmat,项目名称:samplebator,代码行数:31,代码来源:server_common.inc.php

示例14: PMA_asWKT

/**
 * Converts GIS data to Well Known Text format
 *
 * @param binary $data        GIS data
 * @param bool   $includeSRID Add SRID to the WKT
 *
 * @return GIS data in Well Know Text format
 */
function PMA_asWKT($data, $includeSRID = false)
{
    // Convert to WKT format
    $hex = bin2hex($data);
    $wktsql = "SELECT ASTEXT(x'" . $hex . "')";
    if ($includeSRID) {
        $wktsql .= ", SRID(x'" . $hex . "')";
    }
    $wktresult = PMA_DBI_try_query($wktsql, null, PMA_DBI_QUERY_STORE);
    $wktarr = PMA_DBI_fetch_row($wktresult, 0);
    $wktval = $wktarr[0];
    if ($includeSRID) {
        $srid = $wktarr[1];
        $wktval = "'" . $wktval . "'," . $srid;
    }
    @PMA_DBI_free_result($wktresult);
    return $wktval;
}
开发者ID:AmberWish,项目名称:laba_web,代码行数:26,代码来源:common.lib.php

示例15: countRecords

 /**
  * Counts and returns (or displays) the number of records in a table
  *
  * Revision 13 July 2001: Patch for limiting dump size from
  * vinay@sanisoft.com & girish@sanisoft.com
  *
  * @param   string   the current database name
  * @param   string   the current table name
  * @param   boolean  whether to force an exact count
  *
  * @return  mixed    the number of records if "retain" param is true,
  *                   otherwise true
  *
  * @access  public
  */
 public static function countRecords($db, $table, $force_exact = false, $is_view = null)
 {
     if (isset(PMA_Table::$cache[$db][$table]['ExactRows'])) {
         $row_count = PMA_Table::$cache[$db][$table]['ExactRows'];
     } else {
         $row_count = false;
         if (null === $is_view) {
             $is_view = PMA_Table::isView($db, $table);
         }
         if (!$force_exact) {
             if (!isset(PMA_Table::$cache[$db][$table]['Rows']) && !$is_view) {
                 PMA_Table::$cache[$db][$table] = PMA_DBI_fetch_single_row('SHOW TABLE STATUS FROM ' . PMA_backquote($db) . ' LIKE \'' . PMA_sqlAddslashes($table, true) . '\'');
             }
             $row_count = PMA_Table::$cache[$db][$table]['Rows'];
         }
         // for a VIEW, $row_count is always false at this point
         if (false === $row_count || $row_count < $GLOBALS['cfg']['MaxExactCount']) {
             if (!$is_view) {
                 $row_count = PMA_DBI_fetch_value('SELECT COUNT(*) FROM ' . PMA_backquote($db) . '.' . PMA_backquote($table));
             } else {
                 // For complex views, even trying to get a partial record
                 // count could bring down a server, so we offer an
                 // alternative: setting MaxExactCountViews to 0 will bypass
                 // completely the record counting for views
                 if ($GLOBALS['cfg']['MaxExactCountViews'] == 0) {
                     $row_count = 0;
                 } else {
                     // Counting all rows of a VIEW could be too long, so use
                     // a LIMIT clause.
                     // Use try_query because it can fail (when a VIEW is
                     // based on a table that no longer exists)
                     $result = PMA_DBI_try_query('SELECT 1 FROM ' . PMA_backquote($db) . '.' . PMA_backquote($table) . ' LIMIT ' . $GLOBALS['cfg']['MaxExactCountViews'], null, PMA_DBI_QUERY_STORE);
                     if (!PMA_DBI_getError()) {
                         $row_count = PMA_DBI_num_rows($result);
                         PMA_DBI_free_result($result);
                     }
                 }
             }
             PMA_Table::$cache[$db][$table]['ExactRows'] = $row_count;
         }
     }
     return $row_count;
 }
开发者ID:kolbermoorer,项目名称:edugame,代码行数:58,代码来源:Table.class.php


注:本文中的PMA_DBI_try_query函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。