1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
<?php
$connexion = mysql_connect("localhost","root","");
if ($connexion)
{
// connexion réussie
mysql_select_db("bijouterie",$connexion);
$requete="select * from bijoux where Nom like '%".$_POST["nom"]."%' and id_bijoux like '".$_POST["ref"]."';";
$resultat = mysql_query($requete) or die ('Erreur SQL !<br />'.$requete.'<br />'.mysql_error());
$ligne = mysql_fetch_assoc($resultat);
if ($ligne) //Si on trouve un produit afficher le tableau ou il apparaitra
{
echo '<p><table border="4" width="75%"></p>';
echo '<tr><th width="15%">id_bijoux</th><th width="19%">Nom</th><th width="37%">descriptif</th><th width="14%">Prix</th><th width="13%">image</th></tr>';
while($ligne)
{
echo '<tr>';
echo '<td>'.$ligne["id_bijoux"].'</td>';
echo '<td>'.$ligne["Nom"].'</td>';
echo '<td>'.$ligne["Descriptif"].'</td>';
echo '<td>'.$ligne["Prix"].'</td><br/>';
echo '<td><img src="./images/'.$ligne["image"].'.jpg" /></td>';
$ligne=mysql_fetch_assoc($resultat);
}
} |
Partager