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 = ''; } // test for a PHP3 problem, to be confirmed: if (!isset($Criteria)) { //$Criteria = ''; $Criteria = array(); for ($i=0; $i<$Columns; $i++) { $Criteria[$i]=''; } } if (!isset($InsRow)) { $InsRow = ''; } if (!isset($DelRow)) { $DelRow = ''; } if (!isset($AndOrRow)) { $AndOrRow = ''; } if (!isset($AndOrCol)) { $AndOrCol = ''; } $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); $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 < mysql_num_rows($tbl_result)) { $tbl = mysql_tablename($tbl_result, $i); $fld_results = mysql_list_fields($db, $tbl); $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++] = backquote($tbl) . '.*'; while ($j < mysql_num_fields($fld_results)) { $fld[$k] = mysql_field_name($fld_results, $j); $fld[$k] = backquote($tbl) . '.' . $fld[$k]; $k++; $j++; } // end while } // end if $i++; } // end if /** * Displays the form */ ?>