Problème de conditions

samiapirou Messages postés 112 Date d'inscription   Statut Membre Dernière intervention   -  
Alain_42 Messages postés 5361 Date d'inscription   Statut Membre Dernière intervention   -
Bonjour,
j'ai fais une fonction qui callcule le totale mais y a 3 condition le problème c'est que il prend toujour la première condition
aider moi svp :::
voila le code:::
function MontantGlobal(){



$req1= mysql_query("SELECT COUNT(*) AS existe1 FROM client ")or die(mysql_error());

$donnees1 = mysql_fetch_array($req1);



if($donnees1['existe1']!=0)

{
$req1= mysql_query("SELECT * FROM client")or die(mysql_error());

$donnees = mysql_fetch_array($req1);

$_SESSION['etat_cli']=$donnees['etat_client']; //variable session



$total=0;
for($i = 0; $i < count($_SESSION['panier']['refProduit']); $i++)
{

if($_SESSION['etat_cli']="particulier")

$total += $_SESSION['panier']['qteProduit'][$i] * $_SESSION['panier']['prixProduit'][$i];


else if
( $_SESSION['etat_cli']="Anseig"){
$total += $_SESSION['panier']['qteProduit'][$i] * $_SESSION['panier']['prixAnseig'][$i];
}


else if($_SESSION['etat_cli']="moudjahid") {
$total += $_SESSION['panier']['qteProduit'][$i] * $_SESSION['panier']['prixLicence'][$i];
}
return $total;
}
}
}

1 réponse

Alain_42 Messages postés 5361 Date d'inscription   Statut Membre Dernière intervention   894
 
grosse erreur

if($_SESSION['etat_cli']="particulier")

pour comparer c'est == et pas =
0