j'un probleme avec la modification des donnees d'une base ,
lorsqu'i y a une seul ligne pas de probleme la modification est bien faite, mais le probleme lorsqu'il y a plusieurs lignes , elles seront modifier tous.
la modification se faits sur deux pages, voila la premiere page:
<? include("connect_base.php");
connect_base();
?>
<html>
<style type="text/css">
<!
.Style1 {
font-size: 18px;
font-weight: bold;
font-family: Arial, Helvetica, sans-serif;
}
.Style1 {font-size: 18px}
.Style2 {
font-size: 18px;
font-weight: bold;
font-family: Arial, Helvetica, sans-serif;
}
</style>
<body bgcolor="#CCCCCC">
<div align="center" class="Style1">
<p class="Style2">PAGE MODIFICATION ET SUPPRESSION DES LOGOS</p>
<p> </p>
<p> </p>
</div>
<table width="100%" border="2">
<tr bordercolor="f5f5f5" bgcolor="efefef">
<td width="2%"> <div align="center"><font size="1" face="Tahoma"><strong>Id</strong></font></div></td>
<td width="7%"> <div align="center"><font size="1" face="Tahoma"><strong>Nom du logo</strong></font></div></td>
<td width="7%"> <div align="center"><font size="1" face="Tahoma"><strong>Type du logo</strong></font></div></td>
<td width="7%"> <div align="center"><font size="1" face="Tahoma"><strong>Date d'insertion</strong></font></div></td>
<td width="7%"> <div align="center"><font size="1" face="Tahoma"><strong>Nom du theme</strong></font></div></td>
<td width="7%"> <div align="center"><font size="1" face="Tahoma"><strong>Marque du portable</strong></font></div></td>
<td width="7%"> <div align="center"><font size="1" face="Tahoma"><strong>Modele du portable</strong></font></div></td>
<td width="7%"> <div align="center"><font size="1" face="Tahoma"><strong>Modifier</strong></font></div></td>
<td width="7%"> <div align="center"><font size="1" face="Tahoma"><strong>Supprimer</strong></font></div></td></tr>
<?
$res = mysql_query("select * from logo");
$num = mysql_num_rows ($res);
$i=0;
$res1 = mysql_query("select nom_theme from theme where categorie_theme='logo'");
$num1 = mysql_num_rows ($res1);
$res2 = mysql_query("select marque_du_portable,modele_du_portable from portable");
$num2 = mysql_num_rows ($res2);
while (($i<$num)&&($i<$num1)&&($i<$num2))
{
$id_logo = mysql_result ($res,$i,"id_logo");
$nom_logo = mysql_result ($res,$i,"nom_logo");
$type_logo = mysql_result ($res,$i,"type_logo");
$date_insertion = mysql_result ($res,$i,"date_insertion");
$nom_theme = mysql_result ($res1,$i,"nom_theme");
$marque_du_portable = mysql_result ($res2,$i,"marque_du_portable");
$modele_du_portable = mysql_result ($res2,$i,"modele_du_portable");
list($year, $month, $day) = explode("-", $date_insertion);
$date2 = "$day-$month-$year";
echo"<tr><td><b><div align='center'><font face = tahoma size = 2>".$id_logo."</b></font></div></td><td><b><div align='center'><font face = tahoma size = 2>".$nom_logo."</font></b></div></td><td><b><div align='center'><font face = tahoma size = 2>".$type_logo."</font></b></div></td><td><b><div align='center'><font face = tahoma size = 2>".$date2."</font></b></div></td><td><b><div align='center'><font face = tahoma size = 2>".$nom_theme."</b></font></div></td><td><b><div align='center'><font face = tahoma size = 2>".$marque_du_portable."</b></font></div></td><td><b><div align='center'><font face = tahoma size = 2>".$modele_du_portable."</b></font></div></td><div align='center'><td><p><a href='page_modifier.php'><img src=editer.gif ></a></p></td><div align='center'><b></b><td><p><a href='page_supprimer.php'><img src=suppr.gif ></a></p></td></tr>";
$i++;
}
?>
</table>
</body>
</html>
la deuxièmes pages (le pb et dans cette page):
<? include("connect_base.php");
connect_base();
?>
<?php
$date=strftime("%Y-%m-%d %H:%M:%S");
$nom_logo=$_POST['nom_logo'];
$type_logo=$_POST['type_logo'];
$sql="UPDATE logo SET `nom_logo`='$nom_logo',`type_logo`='$type_logo',`date_insertion`='$date'";
mysql_query($sql);
$nom_theme=$_POST['nom_theme'];
$sql1="UPDATE theme SET `nom_theme`='$nom_theme' WHERE categorie_theme='logo'";
mysql_query($sql1);
$marque_du_portable=$_POST['marque_du_portable'];
$modele_du_portable=$_POST['modele_du_portable'];
$sql2="UPDATE portable SET `marque_du_portable`='$marque_du_portable',`modele_du_portable`='$modele_du_portable'";
mysql_query($sql2);
?>
<html>
<style type="text/css">
<!
.Style1 {
font-size: 18px;
font-weight: bold;
font-family: Arial, Helvetica, sans-serif;
}
.Style1 {font-size: 18px}
.Style2 {
font-size: 18px;
font-weight: bold;
font-family: Arial, Helvetica, sans-serif;
}
</style>
<body bgcolor="#CCCCCC">
<div align="center" class="Style1">
<p class="Style2">MODIFICATION BIEN FAITE</p> <a href="page_administration.php">RETOURNER A LA PAGE D'ADMINISTRATION</a>
<p> </p>
<p> </p>
</div>
</body>
</html>

