Código PHP:
Ver original<! -- Program: mysql_send.php
Desc: PHP Program thar sends an SQL query to the
MySQL server and displays the results
-->
<html>
<head><title>SQL Quey Sender</title></head>
<body>
<?php
$host="aca va el host";
$user=" aca va el user ";
$password="aca va la contraseña";
/* Section that executes query */
if (@$_GET['form'] == "yes")
{
echo "Database Selected:<b>{$_POST['database']}</b><br>
Query: <b>$query</b><h3>Results</h3><hr>";
if($result == 0)
"</b>";
echo("<b>Query Completed. No results returned.
</b><br>");
else
{
echo "<table border='1'>
<thead>
<tr>";
{
"</th>";
}
echo " </tr>
</thead>
<tbody>";
{
echo "<tr>";
$row = mysql_fetch_rows($result);
{
echo("<td>" . $row[$j] . "</td>");
}
echo "</tr>";
}
echo "</tbody>
</table>";
} // end else
echo "
<hr><br>
<form action=\"{$_SERVER['PHP_SELF']}\"method=\"POST\">
<input type='hidden' name='query' value='$query'>
<input type='hidden' name='database'
value={$_POST['database']}>
<input type='submit' name=\"queryButton\"
value=\"New Query\">
<input type='submit' name=\"queryButton\"
value=\"Edit Query\">
</form>";
} // endif form=yes
/* Section that requests user input of query */
if (@$_POST['queryButton'] != "Edit Query")
{
$query = " ";
}
?>
<form action="<?php echo $_SERVER['PHP_SELF'] ?>?form=yes"
method="POST">
<table>
<tr>
<td align=right><b>Type in database name</b></td>
<td><input type="text" name="database"
value=<?php echo @$_POST['database'] ?> ></td>
</tr>
<tr>
<td align="right" valign="top">
<b>Type in SQL query</b></td>
<td><textarea name="query" cols="60"
rows="10"><?php echo $query ?></textarea>
</td>
</tr>
<tr>
<td colspan="2" align="center"><input type="submit"
value="Submit Query"></td>
</tr>
</table>
</form>
</body></html>
?>
pues tenias 3 errores,
colocaste fijate en tus for, nunca asignas un valor inicial a $i;
y hay una linea donde POST tiene simbolos raros.
compara los cósdigos y observa tus errores