cs_faty86
Messages postés20Date d'inscriptionmercredi 20 février 2008StatutMembreDernière intervention 5 juin 2008
-
20 avril 2008 à 17:34
cs_faty86
Messages postés20Date d'inscriptionmercredi 20 février 2008StatutMembreDernière intervention 5 juin 2008
-
20 avril 2008 à 18:55
Salut !!
J'ai un code php et lors de la compilation j'ai 2erreurs que je n'arrive pas a trouver !
Voici le resultat de la compilation :
"partie supprimer site
Notice: Undefined offset: 2 in c:\program files\easyphp1-8\www\rymouchacode\affsite.php on line 129
Notice: Undefined offset: 2 in c:\program files\easyphp1-8\www\rymouchacode\affsite.php on line 134"
$res=mysql_query("select * from Site where ID_Site='".$_POST["liste"]."'");
$res2=mysql_query("select * from Connexion where ID_Site_CNX='".$_POST["liste"]."'");
$req=mysql_query("delete from Site where ID_Site='".$_POST["liste"]."'");
echo'suppression site reussie';
}
else
{ while($ln=mysql_fetch_array($res2))
{$tabcnx[$i]='.$ln[ID_CNX].';
$i++;
}
for($j=1;$j<=$i;$j++)
{
==>ligne129 $res3=mysql_query("select * from Etat where ID_CNX_E='$tabcnx[$j]'");
if(mysql_num_rows($res3)==0)
{
==>ligne134 $req=mysql_query("delete from Connexion where ID_CNX='$tabcnx[$j]'");
}
else
{ while($ln1=mysql_fetch_array($res3))
{$tabeq[$k]='.$ln1[ID_EQ_E].';
$k++;
}
for($f=1;$f<=$k;$f++)
{
$req=mysql_query("delete from `Etat` where `ID_CNX_E`='$tabcnx[$j]' and `ID_EQ_E`='$tabeq[$f]'");
}
$req2=("delete from Connexion where ID_CNX='$tabcnx[$j]'");
}
}
$req4=mysql_query("delete from `Site` where `ID_Site`='".$_POST["liste"]."'");
}
break;}
}
}
}
mysql_close($link);
?>
</form>
</html>
Vraiment je n'arrive pas a trouver ce qui cloche!!! merci de m'aider
malalam
Messages postés10839Date d'inscriptionlundi 24 février 2003StatutMembreDernière intervention 2 mars 201025 20 avril 2008 à 18:45
Hello,
le problème est exactement ce que te dit php : Un tableau contient un index valant 2 qui n'existe pas.
$tabcnx[$j] => $j vaut 2, et $tabcnx[2) n'existe pas.