Hello everybody
In advance excuse me for my bad english
I am beginner in programming and development. I have a little problem, and I want your help please. I have create one database with phpmyadmin. In this database there are two tables. The first is “plats” and the second “categories”
The “plats” table content prices. And I want sort price and take only “plats” under 5€
When I put this in the navigator:
http://localhost/resto/menu.php?categories=4&prixMax=5
The navigator display all prices !
There is my file menu.php
<html>
<head>
<title>Menu du jour !</title>
</head>
<body>
<table border=1>
<caption><h3>Liste des plats</h3></caption>
<tr>
<th>Plat</th>
<th>Prix</th>
</tr>
<?php
mysql_connect("localhost","root","");
mysql_select_db("restaurant");
$maRequete="SELECT LibPlat,PrixPlat FROM plats WHERE IdCategorie=".$_REQUEST['categories']."AND PrixPlat<".$_REQUEST['PrixMax'];
//echo ($maRequete);
$rs=mysql_query($maRequete);
while ($row=mysql_fetch_array($rs)){
echo ("<tr><td>".$row['LibPlat']."</td><td align=\"right\">".$row['PrixPlat']."€</td></tr><br/>\n");
}
?>
</table>
</body>
</html>