<head> </head>
<body> <?php require("sql_class.inc");
$database = $_POST["database"]; $query = $_POST["query"]; $server = $_POST["server"]; $user = $_POST["user"]; $pass = $_POST["pass"];
?>
<form action="index.php" method="post"> Server: <input type="text" value="<?php print $server;?>" name="server"><br> User: <input type="text" value="<?php print $user;?>" name="user"><br> Pass: <input type="password" value="<?php print $pass;?>" name="pass"><br>
Database: <input type="text" value="<?php print $database;?>" name="database"><br>
Query: <textarea name="query" cols=50 rows=10><?php print $query; ?></textarea><br>
<input type="submit" value="Gerar Query"> </form>
<?
if ($server != "" && $user != "" && $pass != "" && $query != "" && $database != "") {
$table = new sql_query;
$table->set_vars("$server","$user","$pass","$database");
$table->query("$query");
$table->tableindex(); $table->tablemount();
print "<table border=1><tr>\n";
foreach ($table->columns as $coluna) { print "<td><b>$coluna</b></td>"; } print "</tr>";
foreach ($table->result as $row) { print "<tr>\n"; foreach($table->columns as $column) { $field_result = $row->$column; print "<td>$field_result  </td>"; } print "</tr>\n"; } print "</table>" ; } ?>
|