executes it, else displays the headers */ if (isset($submit_sql)) { $goto = 'db_details.php3'; $zero_rows = htmlspecialchars($strSuccess); $sql_query = urldecode($encoded_sql_query); if (get_magic_quotes_gpc()) { $sql_query = addslashes($sql_query); } include('./sql.php3'); exit(); } else { include('./header.inc.php3'); } /** * Initializes 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 = ''; } if (!isset($DelCol)) { $DelCol = ''; } if (!isset($prev_Criteria)) { $prev_Criteria = ''; } // workaround for a PHP3 problem if (!isset($Criteria)) { //$Criteria = ''; $Criteria = array(); for ($i = 0; $i < $Columns; $i++) { $Criteria[$i] = ''; } } if (!isset($InsRow)) { // $InsRow = ''; $InsRow = array(); for ($i = 0; $i < $Columns; $i++) { $InsRow[$i] = ''; } } if (!isset($DelRow)) { // $DelRow = ''; $DelRow = array(); for ($i = 0; $i < $Columns; $i++) { $DelRow[$i] = ''; } } if (!isset($AndOrRow)) { // $AndOrRow = ''; $AndOrRow = array(); for ($i = 0; $i < $Columns; $i++) { $AndOrRow[$i] = ''; } } if (!isset($AndOrCol)) { // $AndOrCol = ''; $AndOrCol = array(); for ($i = 0; $i < $Columns; $i++) { $AndOrCol[$i] = ''; } } $wid = 12; $widem = $wid . 'em'; $col = $Columns + $Add_Col; if ($col < 0) { $col = 0; } $row = $Rows + $Add_Row; if ($row < 0) { $row = 0; } /** * Prepares the form */ $tbl_result = mysql_list_tables($db); $tbl_result_cnt = mysql_num_rows($tbl_result); $i = 0; $k = 0; // The tables list sent by a previously submitted form if (!empty($TableList)) { for ($x = 0; $x < sizeof($TableList); $x++) { $tbl_names[$TableList[$x]] = ' selected="selected"'; } } // end if // The tables list gets from MySQL while ($i < $tbl_result_cnt) { $tbl = mysql_tablename($tbl_result, $i); $fld_results = mysql_list_fields($db, $tbl); $fld_results_cnt = mysql_num_fields($fld_results); $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] = mysql_field_name($fld_results, $j); $fld[$k] = PMA_backquote($tbl) . '.' . PMA_backquote($fld[$k]); $k++; $j++; } // end while } // end if mysql_free_result($fld_results); $i++; } // end if mysql_free_result($tbl_result); /** * Displays the form */ ?>