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 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
|
<table width="652" border="0">
<?
// connexion à la base
$db = mysql_connect('sql', 'xxx', 'xxxx') or die('Erreur de connexion '.mysql_error());
?>
<tr bgcolor="#99FFFF">
<td width="60%"><b>Référence du Matériel</b></td>
<td width="5%">
<div align="center"><b>Matériel</b></div>
</td>
<td width="20%">
<div align="center"><b>Nom de l'acheteur</b></div>
</td>
<td width="10%"><div align="center"><b>Tapez votre nom</b></div></td>
<td width="5%"><div align="center"><b>Tapez votre prix</b></div></td>
<td width="5%"><div align="center"><b>Détail du produit</b></div></td>
</tr>
<?
// sélection de la base
mysql_select_db('xxx',$db) or die('Erreur de selection '.mysql_error());
$sql = "SELECT * FROM `enchere`";
// on envoie la requête
$req = mysql_query($sql) or die('Erreur SQL !<br>'.$sql.'<br>'.mysql_error());
// on fait une boucle qui va faire un tour pour chaque enregistrement
while($data = mysql_fetch_assoc($req))
{
?>
<form name="form" method="post" >
<tr bgcolor="#FFFF66">
<td width="5%" height="53">
<input type="text" name="id_materiel" size="10" value="<? echo $data[id_materiel];?>">
</td>
<td width="50%" height="53">
<input type="text" name="nom_materiel" size="60" value="<? echo $data[nom_materiel];?>">
</td>
<td width="20%" height="53">
<input type="text" name="nom_acheteur" value="<? echo $data[nom_acheteur];?>">
</td>
<td width="10%" height="53">
<input type="text" name="prix" value="<? echo $data[prix];?>" maxlength="4" size="10">
</td>
<td width="10%" height="53">
<input type="submit" name="encherir" value="Encherir" )>envoyer >
</td>
<td width="10%" height="53">
<input type="submit" name="detail" value="Détail">
</td>
</tr></form>
<? }
// on ferme la connexion à mysql
mysql_close();
?>
</table> |
Partager