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
| <?php
session_start();
include('controlesession.php');
// Make a MySQL Connection
mysql_connect("localhost", "root", "" ) or die(mysql_error());
mysql_select_db("matable" ) or die(mysql_error());
// ********************************* initialisation table ************************
echo '<table>';
// ----------------------------- copie de tabarticle dans $row ---------------------
for ($i=1 $i <8;$i++) {
$result = mysql_query("SELECT * FROM tabarticle where id = '$i'" )
or die(mysql_error());
// stockage d'une ligne dans $row
$row = mysql_fetch_array( $result );
// **********************************affichage dutableau
echo "<tr>";
echo '<td>';
echo 'id : '. $row['id'];
echo 'nom : '.$row['nom'];
echo "<br/>";
$formatted = number_format($row['prix']);
echo $formatted. " "."uros" ;
echo "<br/>";
//etc....
echo '</td>';
echo '</tr>';
}
echo '</table>';
mysql_close;
// formulaire
echo '<form method ="post" action ="ajoutpanier.php">';
echo 'combien en voulez -vous ?<input "type="text " name = "nombre" value ="" size ="2"></input>';
echo '<input type="submit" value="ajouter au caddie">';
echo '</form>';
?> |
Partager