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


PHP PMA_mysqlDie函数代码示例

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


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

示例1: 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  integer  the ressource 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)
{
    global $err_url_0, $db, $dbh, $cfgRelation;
    if (isset($dbh)) {
        PMA_mysql_select_db($cfgRelation['db'], $dbh);
        $result = @PMA_mysql_query($sql, $dbh);
        if (!$result && $show_error == TRUE) {
            PMA_mysqlDie(mysql_error($dbh), $sql, '', $err_url_0);
        }
        PMA_mysql_select_db($db, $dbh);
    } else {
        PMA_mysql_select_db($cfgRelation['db']);
        $result = @PMA_mysql_query($sql);
        if ($result && $show_error == TRUE) {
            PMA_mysqlDie('', $sql, '', $err_url_0);
        }
        PMA_mysql_select_db($db);
    }
    // end if... else...
    if ($result) {
        return $result;
    } else {
        return FALSE;
    }
}
开发者ID:quartemer,项目名称:xoopserver,代码行数:42,代码来源:relation.lib.php

示例2: PMA_myHandler

/**
 * Insert data from one table to another one
 *
 * @param   string  the original insert statement
 *
 * @global  string  the database name
 * @global  string  the original table name
 * @global  string  the target database and table names
 * @global  string  the sql query used to copy the data
 */
function PMA_myHandler($sql_insert = '')
{
    global $db, $table, $target;
    global $sql_insert_data;
    $sql_insert = preg_replace('~INSERT INTO (`?)' . $table . '(`?)~i', 'INSERT INTO ' . $target, $sql_insert);
    $result = PMA_mysql_query($sql_insert) or PMA_mysqlDie('', $sql_insert, '', $GLOBALS['err_url']);
    $sql_insert_data .= $sql_insert . ';' . "\n";
}
开发者ID:quartemer,项目名称:xoopserver,代码行数:18,代码来源:tbl_move_copy.php

示例3: PMA_get_indexes

/**
 * Function to get all index information from a certain table
 *
 * @param   string      Table name
 * @param   string      Error URL
 *
 * @access  public
 * @return  array       Index keys
 */
function PMA_get_indexes($tbl_name, $err_url_0 = '')
{
    $tbl_local_query = 'SHOW KEYS FROM ' . PMA_backquote($tbl_name);
    $tbl_result = PMA_DBI_query($tbl_local_query) or PMA_mysqlDie('', $tbl_local_query, '', $err_url_0);
    $tbl_ret_keys = array();
    while ($tbl_row = PMA_DBI_fetch_assoc($tbl_result)) {
        $tbl_ret_keys[] = $tbl_row;
    }
    PMA_DBI_free_result($tbl_result);
    return $tbl_ret_keys;
}
开发者ID:BackupTheBerlios,项目名称:smileinstaller,代码行数:20,代码来源:tbl_indexes.lib.php

示例4: PMA_getSearchSqls

 /**
  * Builds the SQL search query
  *
  * @param   string   the table name
  * @param   string   the string to search
  * @param   integer  type of search (1 -> 1 word at least, 2 -> all words,
  *                                   3 -> exact string, 4 -> regexp)
  *
  * @return  array    3 SQL querys (for count, display and delete results)
  *
  * @global  string   the url to retun to in case of errors
  */
 function PMA_getSearchSqls($table, $search_str, $search_option)
 {
     global $err_url;
     // Statement types
     $sqlstr_select = 'SELECT';
     $sqlstr_delete = 'DELETE';
     // Fields to select
     $local_query = 'SHOW FIELDS FROM ' . PMA_backquote($table) . ' FROM ' . PMA_backquote($GLOBALS['db']);
     $res = @PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, FALSE, $err_url);
     $res_cnt = $res ? mysql_num_rows($res) : 0;
     for ($i = 0; $i < $res_cnt; $i++) {
         $tblfields[] = PMA_backquote(PMA_mysql_result($res, $i, 'field'));
     }
     // end if
     $sqlstr_fieldstoselect = ' ' . implode(', ', $tblfields);
     $tblfields_cnt = count($tblfields);
     if ($res) {
         mysql_free_result($res);
     }
     // Table to use
     $sqlstr_from = ' FROM ' . PMA_backquote($GLOBALS['db']) . '.' . PMA_backquote($table);
     // Beginning of WHERE clause
     $sqlstr_where = ' WHERE';
     $search_words = $search_option > 2 ? array($search_str) : explode(' ', $search_str);
     $search_wds_cnt = count($search_words);
     $like_or_regex = $search_option == 4 ? 'REGEXP' : 'LIKE';
     $automatic_wildcard = $search_option < 3 ? '%' : '';
     for ($i = 0; $i < $search_wds_cnt; $i++) {
         // Elimines empty values
         if (!empty($search_words[$i])) {
             for ($j = 0; $j < $tblfields_cnt; $j++) {
                 $thefieldlikevalue[] = $tblfields[$j] . ' ' . $like_or_regex . ' \'' . $automatic_wildcard . $search_words[$i] . $automatic_wildcard . '\'';
             }
             // end for
             $fieldslikevalues[] = $search_wds_cnt > 1 ? '(' . implode(' OR ', $thefieldlikevalue) . ')' : implode(' OR ', $thefieldlikevalue);
             unset($thefieldlikevalue);
         }
         // end if
     }
     // end for
     $implode_str = $search_option == 1 ? ' OR ' : ' AND ';
     $sqlstr_where .= ' ' . implode($implode_str, $fieldslikevalues);
     unset($fieldslikevalues);
     // Builds complete queries
     $sql['select_fields'] = $sqlstr_select . $sqlstr_fieldstoselect . $sqlstr_from . $sqlstr_where;
     $sql['select_count'] = $sqlstr_select . ' COUNT(*) AS count' . $sqlstr_from . $sqlstr_where;
     $sql['delete'] = $sqlstr_delete . $sqlstr_from . $sqlstr_where;
     return $sql;
 }
开发者ID:quartemer,项目名称:xoopserver,代码行数:61,代码来源:db_search.php

示例5: PMA_checkReservedWords

 /**
  * Ensures a database/table/field's name is not a reserved word (for MySQL
  * releases < 3.23.6)
  *
  * @param    string   the name to check
  * @param    string   the url to go back in case of error
  *
  * @return   boolean  true if the name is valid (no return else)
  *
  * @access  public
  *
  * @author   Dell'Aiera Pol; Olivier Blin
  */
 function PMA_checkReservedWords($the_name, $error_url)
 {
     // The name contains caracters <> a-z, A-Z and "_" -> not a reserved
     // word
     if (!ereg('^[a-zA-Z_]+$', $the_name)) {
         return true;
     }
     // Else do the work
     $filename = 'badwords.txt';
     if (file_exists($filename)) {
         // Builds the reserved words array
         $fd = fopen($filename, 'r');
         $contents = fread($fd, filesize($filename) - 1);
         fclose($fd);
         $word_list = explode("\n", $contents);
         // Do the checking
         $word_cnt = count($word_list);
         for ($i = 0; $i < $word_cnt; $i++) {
             if (strtolower($the_name) == $word_list[$i]) {
                 PMA_mysqlDie(sprintf($GLOBALS['strInvalidName'], $the_name), '', FALSE, $error_url);
             }
             // end if
         }
         // end for
     }
     // end if
 }
开发者ID:SalokineTerata,项目名称:intranet,代码行数:40,代码来源:common.lib.php

示例6: foreach

</form>
<div id="pdflayout" class="pdflayout" style="visibility: hidden;">
<?php 
            foreach ($array_sh_page as $key => $temp_sh_page) {
                $drag_x = $temp_sh_page['x'];
                $drag_y = $temp_sh_page['y'];
                $draginit .= '    Drag.init(getElement("table_' . $i . '"), null, 0, parseInt(myid.style.width)-2, 0, parseInt(myid.style.height)-5);' . "\n";
                $draginit .= '    getElement("table_' . $i . '").onDrag = function (x, y) { document.edcoord.elements["c_table_' . $i . '[x]"].value = parseInt(x); document.edcoord.elements["c_table_' . $i . '[y]"].value = parseInt(y) }' . "\n";
                $draginit .= '    getElement("table_' . $i . '").style.left = "' . $drag_x . 'px";' . "\n";
                $draginit .= '    getElement("table_' . $i . '").style.top  = "' . $drag_y . 'px";' . "\n";
                $reset_draginit .= '    getElement("table_' . $i . '").style.left = "2px";' . "\n";
                $reset_draginit .= '    getElement("table_' . $i . '").style.top  = "' . 15 * $i . 'px";' . "\n";
                $reset_draginit .= '    document.edcoord.elements["c_table_' . $i . '[x]"].value = "2"' . "\n";
                $reset_draginit .= '    document.edcoord.elements["c_table_' . $i . '[y]"].value = "' . 15 * $i . '"' . "\n";
                $local_query = 'SHOW FIELDS FROM ' . PMA_backquote($temp_sh_page['table_name']) . ' FROM ' . PMA_backquote($db);
                $fields_rs = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url_0);
                $fields_cnt = mysql_num_rows($fields_rs);
                echo '<div id="table_' . $i . '" class="pdflayout_table"><u>' . $temp_sh_page['table_name'] . '</u>';
                while ($row = PMA_mysql_fetch_array($fields_rs)) {
                    echo "<br>" . htmlspecialchars($row['Field']) . "\n";
                }
                echo '</div>' . "\n";
                mysql_free_result($fields_rs);
                $i++;
            }
            ?>
</div>
<script type="text/javascript">
<!--
function init() {
    refreshLayout();
开发者ID:quartemer,项目名称:xoopserver,代码行数:31,代码来源:pdf_pages.php

示例7: PMA_checkParameters

/* Check parameters */
PMA_checkParameters(array('db', 'table', 'where_clause', 'transform_key'));
/* Select database */
if (!PMA_DBI_select_db($db)) {
    PMA_mysqlDie(sprintf(__('\'%s\' database does not exist.'), htmlspecialchars($db)), '', '');
}
/* Check if table exists */
if (!PMA_DBI_get_columns($db, $table)) {
    PMA_mysqlDie(__('Invalid table name'));
}
/* Grab data */
$sql = 'SELECT ' . PMA_backquote($transform_key) . ' FROM ' . PMA_backquote($table) . ' WHERE ' . $where_clause . ';';
$result = PMA_DBI_fetch_value($sql);
/* Check return code */
if ($result === false) {
    PMA_mysqlDie(__('MySQL returned an empty result set (i.e. zero rows).'), $sql);
}
/* Avoid corrupting data */
@ini_set('url_rewriter.tags', '');
header('Content-Type: ' . PMA_detectMIME($result));
header('Expires: ' . gmdate('D, d M Y H:i:s') . ' GMT');
$filename = PMA_sanitize_filename($table . '-' . $transform_key . '.bin');
header('Content-Disposition: attachment; filename="' . $filename . '"');
if (PMA_USR_BROWSER_AGENT == 'IE') {
    header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
    header('Pragma: public');
} else {
    header('Pragma: no-cache');
    // test case: exporting a database into a .gz file with Safari
    // would produce files not having the current time
    // (added this header for Safari but should not harm other browsers)
开发者ID:BGCX262,项目名称:zuozhenshi-prego-svn-to-git,代码行数:31,代码来源:tbl_get_field.php

示例8: PMA_mysqlDie

 */
require_once 'libraries/common.inc.php';
$GLOBALS['js_include'][] = 'db_search.js';
$GLOBALS['js_include'][] = 'sql.js';
$GLOBALS['js_include'][] = 'makegrid.js';
$GLOBALS['js_include'][] = 'jquery/timepicker.js';
/**
 * Gets some core libraries and send headers
 */
require 'libraries/db_common.inc.php';
/**
 * init
 */
// If config variable $GLOBALS['cfg']['Usedbsearch'] is on false : exit.
if (!$GLOBALS['cfg']['UseDbSearch']) {
    PMA_mysqlDie(__('Access denied'), '', false, $err_url);
}
// end if
$url_query .= '&amp;goto=db_search.php';
$url_params['goto'] = 'db_search.php';
/**
 * @global array list of tables from the current database
 * but do not clash with $tables coming from db_info.inc.php
 */
$tables_names_only = PMA_DBI_get_tables($GLOBALS['db']);
$search_options = array('1' => __('at least one of the words'), '2' => __('all words'), '3' => __('the exact phrase'), '4' => __('as regular expression'));
if (empty($_REQUEST['search_option']) || !is_string($_REQUEST['search_option']) || !array_key_exists($_REQUEST['search_option'], $search_options)) {
    $search_option = 1;
    unset($_REQUEST['submit_search']);
} else {
    $search_option = (int) $_REQUEST['search_option'];
开发者ID:nicokaiser,项目名称:phpmyadmin,代码行数:31,代码来源:db_search.php

示例9: PMA_mysqlDie

    } else {
        PMA_mysqlDie('', '', '', $err_url, false);
        // garvin: An error happened while inserting/updating a table definition.
        // to prevent total loss of that data, we embed the form once again.
        // The variable $regenerate will be used to restore data in libs/tbl_properties.inc.php
        $num_fields = $orig_num_fields;
        $regenerate = true;
    }
}
// end do create table
/**
 * Displays the form used to define the structure of the table
 */
if ($abort == false) {
    if (isset($num_fields)) {
        $num_fields = intval($num_fields);
    }
    // No table name
    if (!isset($table) || trim($table) == '') {
        PMA_mysqlDie($strTableEmpty, '', '', $err_url);
    } elseif (empty($num_fields) || !is_int($num_fields)) {
        PMA_mysqlDie($strFieldsEmpty, '', '', $err_url);
    } elseif (!(PMA_DBI_get_fields($db, $table) === false)) {
        PMA_mysqlDie(sprintf($strTableAlreadyExists, htmlspecialchars($table)), '', '', $err_url);
    } else {
        $action = 'tbl_create.php';
        require './libs/tbl_properties.inc.php';
        // Displays the footer
        require_once './libs/footer.inc.php';
    }
}
开发者ID:BGCX261,项目名称:zhe-project-agri-hg-to-git,代码行数:31,代码来源:tbl_create.php

示例10: PMA_auth_fails


//.........这里部分代码省略.........
</style>
<script language="JavaScript" type="text/javascript">
<!--
    /* added 2004-06-10 by Michael Keck
     *       we need this for Backwards-Compatibility and resolving problems
     *       with non DOM browsers, which may have problems with css 2 (like NC 4)
    */
    var isDOM      = (typeof(document.getElementsByTagName) != 'undefined'
                      && typeof(document.createElement) != 'undefined')
                   ? 1 : 0;
    var isIE4      = (typeof(document.all) != 'undefined'
                      && parseInt(navigator.appVersion) >= 4)
                   ? 1 : 0;
    var isNS4      = (typeof(document.layers) != 'undefined')
                   ? 1 : 0;
    var capable    = (isDOM || isIE4 || isNS4)
                   ? 1 : 0;
    // Uggly fix for Opera and Konqueror 2.2 that are half DOM compliant
    if (capable) {
        if (typeof(window.opera) != 'undefined') {
            var browserName = ' ' + navigator.userAgent.toLowerCase();
            if ((browserName.indexOf('konqueror 7') == 0)) {
                capable = 0;
            }
        } else if (typeof(navigator.userAgent) != 'undefined') {
            var browserName = ' ' + navigator.userAgent.toLowerCase();
            if ((browserName.indexOf('konqueror') > 0) && (browserName.indexOf('konqueror/3') == 0)) {
                capable = 0;
            }
        } // end if... else if...
    } // end if
    document.writeln('<link rel="stylesheet" type="text/css" href="<?php 
    echo defined('PMA_PATH_TO_BASEDIR') ? PMA_PATH_TO_BASEDIR : './';
    ?>
css/phpmyadmin.css.php?lang=<?php 
    echo $GLOBALS['available_languages'][$GLOBALS['lang']][2];
    ?>
&amp;js_frame=right&amp;js_isDOM=' + isDOM + '" />');
//-->
</script>
<noscript>
    <link rel="stylesheet" type="text/css" href="<?php 
    echo defined('PMA_PATH_TO_BASEDIR') ? PMA_PATH_TO_BASEDIR : './';
    ?>
css/phpmyadmin.css.php?lang=<?php 
    echo $GLOBALS['available_languages'][$GLOBALS['lang']][2];
    ?>
&amp;js_frame=right" />
</noscript>

</head>

<body bgcolor="<?php 
    echo $cfg['RightBgColor'];
    ?>
">
<br /><br />
<center>
    <h1><?php 
    echo sprintf($GLOBALS['strWelcome'], ' phpMyAdmin ' . PMA_VERSION);
    ?>
</h1>
</center>
<br />
<table border="0" cellpadding="0" cellspacing="3" align="center" width="80%">
    <tr>
        <td>
    <?php 
    echo "\n";
    $GLOBALS['is_header_sent'] = TRUE;
    //TODO: I have included this div from header.inc.php to work around
    //      an undefined variable in tooltip.js, when the server
    //      is not responding. Work has to be done to merge all code that
    //      starts the page (DOCTYPE and this div) to one place
    ?>
    <div id="TooltipContainer" name="TooltipContainer" onmouseover="holdTooltip();" onmouseout="swapTooltip('default');"></div>
    <?php 
    // if we display the "Server not responding" error, do not confuse users
    // by telling them they have a settings problem
    // (note: it's true that they could have a badly typed host name, but
    //  anyway the current $strAccessDeniedExplanation tells that the server
    //  rejected the connection, which is not really what happened)
    // 2002 is the error given by mysqli
    // 2003 is the error given by mysql
    if (isset($GLOBALS['allowDeny_forbidden']) && $GLOBALS['allowDeny_forbidden']) {
        echo '<p>' . $GLOBALS['strAccessDenied'] . '</p>' . "\n";
    } else {
        if (!isset($GLOBALS['errno']) || isset($GLOBALS['errno']) && $GLOBALS['errno'] != 2002 && $GLOBALS['errno'] != 2003) {
            echo '<p>' . $GLOBALS['strAccessDeniedExplanation'] . '</p>' . "\n";
        }
        PMA_mysqlDie($conn_error, '');
    }
    ?>
        </td>
    </tr>
</table>
<?php 
    require_once './footer.inc.php';
    return TRUE;
}
开发者ID:mike503,项目名称:phpmyadmin,代码行数:101,代码来源:config.auth.lib.php

示例11: foreach

// if there is any message, copy it into $_SESSION as well, so we can obtain it by AJAX call
if (isset($message)) {
    $_SESSION['Import_message']['message'] = $message->getDisplay();
    //  $_SESSION['Import_message']['go_back_url'] = $goto.'?'.  PMA_generate_common_url();
}
// Parse and analyze the query, for correct db and table name
// in case of a query typed in the query window
// (but if the query is too large, in case of an imported file, the parser
//  can choke on it so avoid parsing)
if (strlen($sql_query) <= $GLOBALS['cfg']['MaxCharactersInDisplayedSQL']) {
    require_once './libraries/parse_analyze.lib.php';
}
// There was an error?
if (isset($my_die)) {
    foreach ($my_die as $key => $die) {
        PMA_mysqlDie($die['error'], $die['sql'], '', $err_url, $error);
    }
}
// we want to see the results of the last query that returned at least a row
if (!empty($last_query_with_results)) {
    // but we want to show intermediate results too
    $disp_query = $sql_query;
    $disp_message = __('Your SQL query has been executed successfully');
    $sql_query = $last_query_with_results;
    $go_sql = true;
}
if ($go_sql) {
    require './sql.php';
} else {
    $active_page = $goto;
    require './' . $goto;
开发者ID:davidmottet,项目名称:automne,代码行数:31,代码来源:import.php

示例12: PMA_DBI_query

        PMA_DBI_query($sql_query);
        $message = sprintf($GLOBALS['strPasswordChanged'], '\'' . $username . '\'@\'' . $hostname . '\'');
    } else {
        if (empty($pma_pw) || empty($pma_pw2)) {
            $message = $GLOBALS['strPasswordEmpty'];
        } else {
            if ($pma_pw != $pma_pw2) {
                $message = $GLOBALS['strPasswordNotSame'];
            } else {
                $hidden_pw = '';
                for ($i = 0; $i < strlen($pma_pw); $i++) {
                    $hidden_pw .= '*';
                }
                $local_query = 'SET PASSWORD FOR \'' . PMA_sqlAddslashes($username) . '\'@\'' . $hostname . '\' = PASSWORD(\'' . PMA_sqlAddslashes($pma_pw) . '\')';
                $sql_query = 'SET PASSWORD FOR \'' . PMA_sqlAddslashes($username) . '\'@\'' . $hostname . '\' = PASSWORD(\'' . $hidden_pw . '\')';
                PMA_DBI_try_query($local_query) or PMA_mysqlDie(PMA_DBI_getError(), $sql_query);
                $message = sprintf($GLOBALS['strPasswordChanged'], '\'' . $username . '\'@\'' . $hostname . '\'');
            }
        }
    }
}
/**
 * Deletes users
 *   (Changes / copies a user, part IV)
 */
$user_host_separator = chr(27);
if (!empty($delete) || !empty($change_copy) && $mode < 4) {
    if (!empty($change_copy)) {
        $selected_usr = array($old_username . $user_host_separator . $old_hostname);
    } else {
        $queries = array();
开发者ID:BackupTheBerlios,项目名称:vhcs-svn,代码行数:31,代码来源:server_privileges.php

示例13: PMA_getTableCsv

 /**
  * Outputs the content of a table in CSV format
  *
  * Last revision 14 July 2001: Patch for limiting dump size from
  * vinay@sanisoft.com & girish@sanisoft.com
  *
  * @param   string   the database name
  * @param   string   the table name
  * @param   integer  the offset on this table
  * @param   integer  the last row to get
  * @param   string   the field separator character
  * @param   string   the optionnal "enclosed by" character
  * @param   string   the handler (function) to call. It must accept one
  *                   parameter ($sql_insert)
  * @param   string   the url to go back in case of error
  *
  * @global  string   whether to obtain an excel compatible csv format or a
  *                   simple csv one
  *
  * @return  boolean always true
  *
  * @access  public
  */
 function PMA_getTableCsv($db, $table, $limit_from = 0, $limit_to = 0, $sep, $enc_by, $esc_by, $handler, $error_url)
 {
     global $what;
     // Handles the "separator" and the optionnal "enclosed by" characters
     if ($what == 'excel') {
         $sep = ',';
     } else {
         if (!isset($sep)) {
             $sep = '';
         } else {
             if (get_magic_quotes_gpc()) {
                 $sep = stripslashes($sep);
             }
             $sep = str_replace('\\t', "\t", $sep);
         }
     }
     if ($what == 'excel') {
         $enc_by = '"';
     } else {
         if (!isset($enc_by)) {
             $enc_by = '';
         } else {
             if (get_magic_quotes_gpc()) {
                 $enc_by = stripslashes($enc_by);
             }
         }
     }
     if ($what == 'excel' || empty($esc_by) && $enc_by != '') {
         // double the "enclosed by" character
         $esc_by = $enc_by;
     } else {
         if (!isset($esc_by)) {
             $esc_by = '';
         } else {
             if (get_magic_quotes_gpc()) {
                 $esc_by = stripslashes($esc_by);
             }
         }
     }
     // Defines the offsets to use
     if ($limit_from > 0) {
         $limit_from--;
     } else {
         $limit_from = 0;
     }
     if ($limit_to > 0 && $limit_from >= 0) {
         $add_query = " LIMIT {$limit_from}, {$limit_to}";
     } else {
         $add_query = '';
     }
     // Gets the data from the database
     $local_query = 'SELECT * FROM ' . PMA_backquote($db) . '.' . PMA_backquote($table) . $add_query;
     $result = mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $error_url);
     $fields_cnt = mysql_num_fields($result);
     @set_time_limit($GLOBALS['cfgExecTimeLimit']);
     // Format the data
     $i = 0;
     while ($row = mysql_fetch_row($result)) {
         $schema_insert = '';
         for ($j = 0; $j < $fields_cnt; $j++) {
             if (!isset($row[$j])) {
                 $schema_insert .= 'NULL';
             } else {
                 if ($row[$j] == '0' || $row[$j] != '') {
                     // loic1 : always enclose fields
                     if ($what == 'excel') {
                         $row[$j] = ereg_replace("\r(\n)?", "\n", $row[$j]);
                     }
                     if ($enc_by == '') {
                         $schema_insert .= $row[$j];
                     } else {
                         $schema_insert .= $enc_by . str_replace($enc_by, $esc_by . $enc_by, $row[$j]) . $enc_by;
                     }
                 } else {
                     $schema_insert .= '';
                 }
             }
//.........这里部分代码省略.........
开发者ID:ColBT,项目名称:php_tut,代码行数:101,代码来源:build_dump.lib.php

示例14: mysql_fetch_array

                            $sts_tmp = mysql_fetch_array($sts_result);
                            $tables[] = $sts_tmp;
                        } else {
                            // table in use
                            $tables[] = array('Name' => $tmp[0]);
                        }
                    }
                    mysql_free_result($result);
                    $sot_ready = TRUE;
                }
            }
        }
    }
    if (!isset($sot_ready)) {
        $local_query = 'SHOW TABLE STATUS FROM ' . PMA_backquote($db);
        $result = mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url);
        if ($result != FALSE && mysql_num_rows($result) > 0) {
            while ($sts_tmp = mysql_fetch_array($result)) {
                $tables[] = $sts_tmp;
            }
            mysql_free_result($result);
        }
    }
    $num_tables = isset($tables) ? count($tables) : 0;
} else {
    $result = mysql_list_tables($db);
    $num_tables = @mysql_numrows($result);
    for ($i = 0; $i < $num_tables; $i++) {
        $tables[] = mysql_tablename($result, $i);
    }
    mysql_free_result($result);
开发者ID:SalokineTerata,项目名称:intranet,代码行数:31,代码来源:db_printview.php

示例15: PMA_auth_fails

/**
 * User is not allowed to login to MySQL -> authentication failed
 *
 * @global  string    the MySQL error message PHP returns
 * @global  string    the connection type (persistent or not)
 * @global  string    the MySQL server port to use
 * @global  string    the MySQL socket port to use
 * @global  array     the current server settings
 * @global  string    the font face to use in case of failure
 * @global  string    the default font size to use in case of failure
 * @global  string    the big font size to use in case of failure
 * @global  boolean   tell the "PMA_mysqlDie()" function headers have been
 *                    sent
 *
 * @return  boolean   always true (no return indeed)
 *
 * @access  public
 */
function PMA_auth_fails()
{
    global $php_errormsg, $cfg;
    global $right_font_family, $font_size, $font_bigger;
    if (PMA_DBI_getError()) {
        $conn_error = PMA_DBI_getError();
    } else {
        if (isset($php_errormsg)) {
            $conn_error = $php_errormsg;
        } else {
            $conn_error = $GLOBALS['strConnectionError'];
        }
    }
    // Defines the charset to be used
    header('Content-Type: text/html; charset=' . $GLOBALS['charset']);
    // Defines the theme to be used
    require_once './libraries/select_theme.lib.php';
    /* HTML header */
    $page_title = $GLOBALS['strAccessDenied'];
    require './libraries/header_meta_style.inc.php';
    ?>
</head>

<body bgcolor="<?php 
    echo $cfg['RightBgColor'];
    ?>
">
<br /><br />
<center>
    <h1><?php 
    echo sprintf($GLOBALS['strWelcome'], ' phpMyAdmin ' . PMA_VERSION);
    ?>
</h1>
</center>
<br />
<table border="0" cellpadding="0" cellspacing="3" align="center" width="80%">
    <tr>
        <td>
    <?php 
    echo "\n";
    $GLOBALS['is_header_sent'] = TRUE;
    //TODO: I have included this div from header.inc.php to work around
    //      an undefined variable in tooltip.js, when the server
    //      is not responding. Work has to be done to merge all code that
    //      starts the page (DOCTYPE and this div) to one place
    ?>
    <div id="TooltipContainer" onmouseover="holdTooltip();" onmouseout="swapTooltip('default');"></div>
    <?php 
    // if we display the "Server not responding" error, do not confuse users
    // by telling them they have a settings problem
    // (note: it's true that they could have a badly typed host name, but
    //  anyway the current $strAccessDeniedExplanation tells that the server
    //  rejected the connection, which is not really what happened)
    // 2002 is the error given by mysqli
    // 2003 is the error given by mysql
    if (isset($GLOBALS['allowDeny_forbidden']) && $GLOBALS['allowDeny_forbidden']) {
        echo '<p>' . $GLOBALS['strAccessDenied'] . '</p>' . "\n";
    } else {
        if (!isset($GLOBALS['errno']) || isset($GLOBALS['errno']) && $GLOBALS['errno'] != 2002 && $GLOBALS['errno'] != 2003) {
            echo '<p>' . $GLOBALS['strAccessDeniedExplanation'] . '</p>' . "\n";
        }
        PMA_mysqlDie($conn_error, '');
    }
    ?>
        </td>
    </tr>
</table>
<?php 
    require_once './footer.inc.php';
    return TRUE;
}
开发者ID:BackupTheBerlios,项目名称:vhcs-svn,代码行数:89,代码来源:config.auth.lib.php


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