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
|
$i=0;
$trueValue = 1;
$falseValue = 0;
while ($test0 = mysql_fetch_row($resultat0) )
{
$tab[0][$i]=$test0[0];
$tab[1][$i]=$test0[1];
$i++;
}
$rep = false;
$j=0 ;
while (($j <= $i-1) && ($rep == false))
{
if (($tab[0][$j] == $nom ) && ($tab[1][$j] == $prenom ))
{
$rep = true;
}
$j++;
}
$codecotis = 0;
if ($rep == true)
{$codecotis = 1;}
else
{$codecotis = 2;}
$sql2 = "INSERT INTO adherent ( ID_PERSONNE, ID_ADHERENT,CODE_COTIS, NOM, PRENOM, RUE, CODE_POSTAL, VILLE,DATE_INSCRIPTION,TELEPHONE, EMAIL,OBSERVATION) VALUES ('A', '$codeadherent','$codecotis','$nom','$prenom','$adresse','$codep','$ville','2003-05-20','$*telephone','$email','NULL');";
$result = mysql_query ($sql2, $connexion0) OR die ("Erreur MySQL : ".mysql_error()); |
Partager