par
jimmy28 » 24 juin 2005, 12:20
Voici mon code pour etre plus précis:
<html>
<head>
<title>Votre Panier</title>
</head>
<body>
<?php
mysql_connect ($serveur,$ID,$MDP);
mysql_select_db ($DBname) or die ('ERREUR'.mysql_error());
$code=$_POST["code"];
$designation=$_POST["designation"];
$prix=$_POST["prix"];
$quantite=$_POST["quantite"];
$req="INSERT INTO articles (code,designation,prix,quantite) VALUES ('".$code."','".$designation."','".$prix."','".$quantite."')";
mysql_query($req) or die ('ERREUR '.mysql_error());
$tablo=mysql_query("SELECT * FROM articles");
$nblignes=mysql_num_rows(mysql_query("SELECT * FROM articles"));
echo $nblignes.' lignes';
while ($row=mysql_fetch_array($tablo, MYSQL_NUM)){
echo $row[0]." ".$row[1]." ".$row[2]." ".$row[3]." ".$row[4]."<br>";
}
?>
<CENTER>
<TABLE width=80% border=10>
<TR>
<TD align=center width=10% BGCOLOR="$CCCCCC">Code Produit</TD>
<TD align=center width=70% BGCOLOR="$CCCCCC">Designation</TD>
<TD align=center width=10% BGCOLOR="$CCCCCC">Prix</TD>
<TD align=center width=10% BGCOLOR="$CCCCCC">Quantité</TD>
</TR>
<TR>
<TD align=center width=10%>Code Produit</TD>
<TD align=center width=70%>Designation</TD>
<TD align=center width=10%>Prix</TD>
<TD align=center width=10%>Quantité</TD>
</TR>
</TABLE>
</body>
</html>
Voici mon code pour etre plus précis:
<html>
<head>
<title>Votre Panier</title>
</head>
<body>
<?php
mysql_connect ($serveur,$ID,$MDP);
mysql_select_db ($DBname) or die ('ERREUR'.mysql_error());
$code=$_POST["code"];
$designation=$_POST["designation"];
$prix=$_POST["prix"];
$quantite=$_POST["quantite"];
$req="INSERT INTO articles (code,designation,prix,quantite) VALUES ('".$code."','".$designation."','".$prix."','".$quantite."')";
mysql_query($req) or die ('ERREUR '.mysql_error());
$tablo=mysql_query("SELECT * FROM articles");
$nblignes=mysql_num_rows(mysql_query("SELECT * FROM articles"));
echo $nblignes.' lignes';
while ($row=mysql_fetch_array($tablo, MYSQL_NUM)){
echo $row[0]." ".$row[1]." ".$row[2]." ".$row[3]." ".$row[4]."<br>";
}
?>
<CENTER>
<TABLE width=80% border=10>
<TR>
<TD align=center width=10% BGCOLOR="$CCCCCC">Code Produit</TD>
<TD align=center width=70% BGCOLOR="$CCCCCC">Designation</TD>
<TD align=center width=10% BGCOLOR="$CCCCCC">Prix</TD>
<TD align=center width=10% BGCOLOR="$CCCCCC">Quantité</TD>
</TR>
<TR>
<TD align=center width=10%>Code Produit</TD>
<TD align=center width=70%>Designation</TD>
<TD align=center width=10%>Prix</TD>
<TD align=center width=10%>Quantité</TD>
</TR>
</TABLE>
</body>
</html>