execute it, else display the headers */ if (isset($submit_sql) && preg_match('@^SELECT@i', $encoded_sql_query)) { $goto = 'db_details.php'; $zero_rows = htmlspecialchars($strSuccess); $sql_query = urldecode($encoded_sql_query); require('./sql.php'); exit(); } else { $sub_part = '_qbe'; require('./db_details_common.php'); $url_query .= '&goto=db_details_qbe.php'; require('./db_details_db_info.php'); } if (isset($submit_sql) && !preg_match('@^SELECT@i', $encoded_sql_query)) { echo '

' . $strHaveToShow . '

'; } /** * Initialize some variables */ if (empty($Columns)) { $Columns = 3; // Initial number of columns } if (!isset($Add_Col)) { $Add_Col = ''; } if (!isset($Add_Row)) { $Add_Row = ''; } if (!isset($Rows)) { $Rows = ''; } if (!isset($InsCol)) { $InsCol = array(); } if (!isset($DelCol)) { $DelCol = array(); } if (!isset($prev_Criteria)) { $prev_Criteria = ''; } if (!isset($Criteria)) { $Criteria = array(); for ($i = 0; $i < $Columns; $i++) { $Criteria[$i] = ''; } } if (!isset($InsRow)) { $InsRow = array(); for ($i = 0; $i < $Columns; $i++) { $InsRow[$i] = ''; } } if (!isset($DelRow)) { $DelRow = array(); for ($i = 0; $i < $Columns; $i++) { $DelRow[$i] = ''; } } if (!isset($AndOrRow)) { $AndOrRow = array(); for ($i = 0; $i < $Columns; $i++) { $AndOrRow[$i] = ''; } } if (!isset($AndOrCol)) { $AndOrCol = array(); for ($i = 0; $i < $Columns; $i++) { $AndOrCol[$i] = ''; } } // minimum width $wid = 12; $col = $Columns + $Add_Col; if ($col < 0) { $col = 0; } $row = $Rows + $Add_Row; if ($row < 0) { $row = 0; } /** * Prepares the form */ $tbl_result = PMA_DBI_query('SHOW TABLES FROM ' . PMA_backquote($db) . ';', NULL, PMA_DBI_QUERY_STORE); $tbl_result_cnt = PMA_DBI_num_rows($tbl_result); $i = 0; $k = 0; // The tables list sent by a previously submitted form if (!empty($TableList)) { $cnt_table_list = count($TableList); for ($x = 0; $x < $cnt_table_list; $x++) { $tbl_names[urldecode($TableList[$x])] = ' selected="selected"'; } } // end if // The tables list gets from MySQL while ($i < $tbl_result_cnt) { list($tbl) = PMA_DBI_fetch_row($tbl_result); $fld_results = PMA_DBI_get_fields($db, $tbl); $fld_results_cnt = ($fld_results) ? count($fld_results) : 0; $j = 0; if (empty($tbl_names[$tbl]) && !empty($TableList)) { $tbl_names[$tbl] = ''; } else { $tbl_names[$tbl] = ' selected="selected"'; } // end if // The fields list per selected tables if ($tbl_names[$tbl] == ' selected="selected"') { $fld[$k++] = PMA_backquote($tbl) . '.*'; while ($j < $fld_results_cnt) { $fld[$k] = PMA_convert_display_charset($fld_results[$j]['Field']); $fld[$k] = PMA_backquote($tbl) . '.' . PMA_backquote($fld[$k]); // increase the width if necessary if (strlen($fld[$k]) > $wid) { $wid = strlen($fld[$k]); } //end if $k++; $j++; } // end while } // end if $i++; } // end if PMA_DBI_free_result($tbl_result); // largest width found $realwidth = $wid . 'ex'; /** * Displays the form */ ?>
/>
: : />  
: : />  
: : />
: : />
: />   : />
  
: />   : />
  
:   :  

      
$val) { $strTableListOptions .= ' '; $strTableListOptions .= '' . "\n"; $numTableListOptions++; } ?>