buenas amados hermanos.
estoy realizando una prueba en una tabla para eliminar varios registros seleccionando los registro que quiero eliminar con un checkbox, como el hotmail
en el correo que hay una lista y uno selecciona los checkbox y se eliminan varios,
bueno a toda estas no logro hacerlo, he aqui el codigo.
ESTE ES EL CODIGO DONDE TENGO MI CHECKBOX DE TODA LA PAGINA => INDEX2.PHP
----------------------------------------------------------------------------------------------
<?
$connect=mysql_connect("localhost","root","1717388 6")or die("Error conectar..." .mysql_error());
$db=mysql_select_db('dbprueba');
?>
<html>
<head>
<title>Documento sin título</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<form name="form1" method="post" action="c_index2.php">
<table width="761" border="0">
<tr bgcolor="#FFFFCC">
<td><div align="center"><strong>Nombre</strong></div></td>
<td><div align="center"><strong>Apellido</strong></div></td>
<td><div align="center"><strong>Sexo</strong></div></td>
<td><div align="center"><strong>Ciudad</strong></div></td>
<td><div align="center"><strong>Documento</strong></div></td>
<td><div align="center"><strong>Email</strong></div></td>
<td><div align="center"><strong>Opinion</strong></div></td>
<td><div align="center"><font color="#FF0000"><strong>Eliminar</strong></font></div></td>
</tr>
<?
$sql1="select *from tblcliente";
$query=mysql_query($sql1)or die("Error...1" .mysql_error());
while($resul=mysql_fetch_array($query)){
?>
<tr>
<td><div align="center"><? echo $resul[nombre_cli]?></div></td>
<td><div align="center"><? echo $resul[apellido_cli]?></div></td>
<td><div align="center"><? echo $resul[id_sex]?></div></td>
<td><div align="center">
<?
$sql2="select *from tblciudad where id_ciu=$resul[id_ciu]";
$query2=mysql_query($sql2)or die("Error...2" .mysql_error());
$resul2=mysql_fetch_array($query2);
echo $resul2[nombre_ciu];
?></div></td>
<td><div align="center"><? echo $resul[id_cli]?></div></td>
<td><div align="center"><? echo $resul[email_cli]?></div></td>
<td><div align="center"><? echo $resul[opinion_cli]?></div></td>
<td><div align="center">
<input type="checkbox" name="cEliminar[]" value="<? echo $resul[id_cli]?>">
</div></td>
</tr>
<? } ?>
<tr>
<td colspan="8"><input name="bEliminar" type="submit" id="bEliminar" value="Eliminar">
<input type="reset" name="Submit2" value="Restablecer"></td>
</tr>
</table>
</form>
</body>
</html>
--------------- AQUI LA PAGINA DONDE ESTA EL CODIGO => C_INDEX2.PHP ----------
<?
$connect=mysql_connect("localhost","root","1717388 6")or die("Error conectar" .mysql_error());
$db=mysql_select_db("dbprueba");
foreach($_POST['cEliminar'] as $check){
$sql = "delete tblcliente where id_cli =' " .$check. " ' ";
mysql_query($sql);
header("location:index2.php");
}
mysql_close($connect);
?>
--------------------------------------------------------
ME GUSTARIA UNA AYUDA CON ESTO, PORQUE LO VOY A USAR EN UNA WEB QUE TENGO QUE HACER. SE QUE ME DARAN LA AYUDA.