Bonjour, j'ai les produits du panier qui s'affichent sur ma page "modes_paiement.php" , le nombre d'articles et ainsi que le prix total, j'ai ma table "commande" et les colonnes correspondantes, j'écris dans ma base, mais ça m'écrit un champs vide. JE dois avoir un probleme de syntaxe concernant la récupération de variables.
L'affichage de mon panier :
<?php
session_start();
include_once("../../fonctions-panier.php");
if (creationPanier())
{
$nbArticles=count($_SESSION['panier']['libelleProduit']);
if ($nbArticles <= 0)
echo "<tr><td>Votre panier est vide </ td></tr>";
else
{
for ($i=0 ;$i < $nbArticles ; $i++)
{
echo "<tr>";
echo "<td><center>".htmlspecialchars($_SESSION['panier']['libelleProduit'][$i])."</ center></ td>";
echo "<td><center>".htmlspecialchars($_SESSION['panier']['qteProduit'][$i])."</ center></td>";
echo "<td><center>".htmlspecialchars($_SESSION['panier']['prixProduit'][$i])."</ center></td>";
echo "<td><a href=\"".htmlspecialchars("panier.php?action=suppression&l=".rawurlencode($_SESSION['panier']['libelleProduit'][$i]))."\"></a></td>";
echo "</tr>";
}
echo "<tr><td colspan=\"2\"> </td>";
echo "<td colspan=\"2\">";
echo "<br><br><b>Total : ";
echo sprintf('%.2f',MontantGlobal());
echo " ¤ ttc</b>";
echo " | ";
function prix_ttc($prix_ht,$taux_tva)
{
return ($prix_ht/(1+$taux_tva/100));
}
echo sprintf('%.2f',prix_ttc(MontantGlobal(),19.6));
echo ' ¤ ht';
echo "</td></tr>";
echo "<tr><td colspan=\"4\">";
echo "</td></tr>";
$produit = " echo .htmlspecialchars($_SESSION['panier']['libelleProduit'][$i]).;";
$connect=ODBC_connect("TESTPHP5","sa","sasa");
$sql="Insert into commande (DESIGNATION) Values ('$produit')";
$res=odbc_exec($connect, $sql) or die($sql."<br />".odbc_error());
}
}
?>
le code en gras est ma requete pour écrire dans ma base, ce qui est en souligné est ce qui me pause probleme.
J'espere que avec ce peu de code vous pourrez m'aider.
Merci
Ju'