<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=windows-1250">
<title>MySQLi Administrator table listing</title>
</head>
<body>
<?php
if ($_POST['submit']=="Execute")
{
if ($link=mysqli_connect('147.32.164.26','alik',$_POST["pwd"],'alik') )
{
if (mysqli_real_query($link,$_POST['selline']) ) {
if (strtoupper(substr($_POST['selline'],0,6))=="SELECT")
{
$result=mysqli_use_result($link);
echo "<table border=1>";
if ($row=mysqli_fetch_assoc($result)) {
echo "<tr>";
foreach($row as $key => $value) {echo "<th>".$key; };
echo "<tr>";
foreach($row as $key => $value) {echo "<td>".$value; };
}
while ($row=mysqli_fetch_assoc($result)) {
echo "<tr>";
foreach($row as $key => $value) {echo "<td>".$value; };
}
echo "</table>";
} else
{
echo "SQL command OK, ";
echo mysqli_affected_rows($link);
echo " lines affected";
} } else {echo "SQL error: ".mysqli_error($link);};
mysqli_close($link);
} else {echo 'Error connecting database: '.mysqli_error($link); };
}
?>
<hr>
Insert a new sql command:
<Form action="admini.php" method="post"><br>
<input type="text" size="77" name="selline"
<?php
echo "value='".$_POST['selline']."'><br>\n";
echo 'Database password: <input type="text" name="pwd" value="'.$_POST["pwd"].'">';
?> <br>
<input type="submit" name="submit" value="Execute">
</Form>
</body>
</html>