Skip navigation links

MySQL Forums :: PHP :: Probleme with my php code


Advanced Search

Probleme with my php code
Posted by: ganesh ganesh ()
Date: November 05, 2009 08:31AM

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>

Options: ReplyQuote


Subject Written By Posted
Probleme with my php code ganesh ganesh 11/05/2009 08:31AM
Re: Probleme with my php code Rick James 11/06/2009 09:23PM


Sorry, only registered users may post in this forum.