hi
i hope some of you'll be able to find an answer to my problem
ok
i've a table that generates a list of table rows (including my table key) and populates them with data from a mysql table (by a simple select)
each row has a checkbox next to them to allow multiple row deletions from the database
here's my code :
<?php
$host = MYHOST;
$user = MYUSER;
$bdd = mydb;
$password = mypasswd;
mysql_connect($host, $user,$password) or die("error");
$query = "SELECT A,B,C,D,E,F,G FROM Mytable where Mytable.DELETED='N'";
mysql_select_db($bdd) or die("error");
$result = mysql_query($query);
if (mysql_num_rows($result) != 0) {
while ($row = mysql_fetch_row($result)){
$A = $row[0];
$B = $row[1];
$C = $row[2];
$D = $row[3];
$E = $row[4];
$F = $row[5];
$G = $row[6];
?>
=> then i display my html stuff
<DIV ALIGN="center">
<tr>
<td><a href="/pathtoscript/?A=<?php echo $A?>&Flag=<?php $Flag?>"><?php echo $A ?/a></td>
<td><?php echo $B ?></td>
<td><?php echo $C ?></td>
<td><?php echo $D ?></td>
<td><?php echo $E ?></td>
<td><?php echo $F ?></td>
<td><?php echo $G ?></td>
<td><INPUT TYPE="checkbox" NAME="$files[]" VALUE="<?php echo "$A"; ?>" > <?php echo "$A" ?></td><br>
</tr>
</DIV>
===> A is my key field
<?php
}
mysql_close();
}
?>
==> then i submit
</TABLE>
<BR><BR>
<DIV ALIGN="center">
<FORM ACTION="/pathtosamescript" METHOD=POST>
<INPUT TYPE="submit" VALUE="SUBMIT"
ONSUBMIT=<?php
for ($i=0;$i<count($files);$i++)
{
$sql_id = $sql_id."A='$files$i]'" . " OR ";
}
// Chop off the last OR statement on $sql_id
$sql_id = substr($sql_id, 0, -3);
*/
mysql_connect($host, $user,$password) or die("error");
$query = "Update Appartement set DELETED='O' Where $sql_id ";
mysql_select_db($bdd) or die("error");
$result = mysql_query($query);
// Deconnexion de la base de donnees
mysql_close();
?> >
</DIV>
</FORM>
and then i get no result when i check the row i want to delete (in fact the row isn't really deleted but i set a flag DELETED="O" then i only display the row where my flag="N")
please if some could help quickly it'd be very nice cause i've the same problem on an other column & i've got the same code but it still won't work
hope you'll helpl me