Hello, i made this simple code to show info from my database into a table, the form code is below: http://pastebin.com/yyzcjshn
the show.php code is:
<html>
<head>
<title>Show Result</title>
<?php
$connection = mysql_connect("localhost","root","");
// Check connection
if(!$connection){
die("Database connection failed: " . mysql_error());
}
//select database to use
$db_select = mysql_select_db("sells",$connection);
if(!$db_select){
die("Database selection failed: " . mysql_error());
}
$D1 = $_POST['D1'];
//show info
if($D1 != 'Show All'){
$result = mysql_query("SELECT * FROM clients WHERE Status='$D1'", $connection);
}
else $result = mysql_query("SELECT * FROM clients", $connection);
if(!$result){
die("Database query failed: " . mysql_error());
}
echo "<table border='1'>
<tr>
<th>Order ID</th>
<th>Client Name</th>
<th>URL</th>
<th>Quantity</th>
<th>Price[$]</th>
<th>Status</th>
</tr>";
while($row = mysql_fetch_array($result)){
echo "<tr>";
echo "<td>" . $row["Order_ID"]."</td>";
echo "<td>" . $row["ClientName"]."</td>";
echo "<td><a href=" . $row['Url'] . " target=_blank >" . $row['Url'] . "</a></td>";
echo "<td>" . $row["Quantity"]."</td>";
echo "<td>" . $row["Price"]."</td>";
echo "<td>" . $row["Status"]."</td>";
echo "</tr>";
}
echo "</table>";
mysql_close($connection);
?>
</head>
</html>
How can i show the result in the same page of the submit form using php (without ajax)?