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"
Voici mon code :
<?php
$link = mysql_connect("localhost","root","");
mysql_select_db('administration equip');
$res=mysql_query("select * from Site where ID_Site='".$_POST["liste"]."'");
$res2=mysql_query("select * from Connexion where ID_Site_CNX='".$_POST["liste"]."'");
if(mysql_num_rows($res)==0)
{
header("location:erreur.php");
}
else
{
$lig=mysql_fetch_array($res);
echo'<html>';
echo'<head>';
echo'</head>';
echo'<body>';
if(isset($_POST['bouton']))
{
switch ($_POST['bouton'])
{
case 'Supprimer Site':
{
echo'partie supprimer site';
$tabcnx=array();
$tabeq=array();
$i=0;
$k=0;
if(mysql_num_rows($res2)==0)
{
$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>
</body>
</html>
Vraiment je n'arrive pas a trouver ce qui cloche!!! merci de m'aider 