Unable to connect to the database server at this time.

"; exit(); } //$currDB="world"; if ($_POST['currDB']!="") if (! mysql_select_db($_POST['currDB']) ) { echo "

Unable to access the ".$_POST['currDB']." database. " . " try another.

"; $_POST['currDB'] = ""; //so next iteration starts blank } ?>
method="post"> SQL command->
0) if (eregi( "^ *USE *([[:alnum:]]+)",$_POST['cmd'],$regs)) { $_POST['currDB'] = $regs[1]; if (! mysql_select_db($_POST['currDB']) ) { echo "

Unable to access the ".$_POST['currDB']." database. " . " try another.

"; $_POST['currDB'] = ""; } } else { $result = mysql_query($_POST['cmd']); if (!$result) echo "

Error performing command: ".$_POST['cmd']."
" . mysql_error() . "

"; // echo("

Error performing command:
" . mysql_error() . "

"); else { // echo "

Results

"; echo "

Results for:".$_POST['cmd']."

"; echo("
");
 
//mysql_fetch_array was returning twice the numbr of fields
    while ($row = mysql_fetch_row($result)) {
      $fields = count($row);
//echo "fields=",$fields."
"; for ($i=0; $i<$fields; $i++) echo $row[$i]."\t"; echo "
"; } echo "
"; } } ?>