no me elimina los registros que selcciono pero si los elige que estoy haciendo mal
en este script generola consulta
Código PHP:
<?php
$tabla = $mensaje.$estacion;
$link = mysql_connect("localhost","usuario","pass");
mysql_select_db("RADIOSONDEO",$link);
$sql = "SELECT * from $tabla where Fecha >= '$fechainicio' and Fecha <= '$fechafin' and Hora >= '$bhr' and Hora <= '$ehr'";
$result = mysql_query($sql,$link);
do{
echo "<input type = \"hidden\" name=\"existe[]\" value =\"$row[ID]\"><input type=\"checkbox\" name=\"$row[ID]\">";
}while($row = mysql_fetch_array($result));
mysql_close($link);
echo "<input type='hidden' name='nombre' value=$tabla>";
echo "<input type='submit' name='eliminar' value='Eliminar'>";
?>
y este es el que hace la eliminacion de registros:
Código PHP:
<?php
$nombre = $HTTP_POST_VARS['nombre'];
$existe = $HTTP_POST_VARS['existe'];
$link = mysql_connect("localhost","usuario","pass");
mysql_select_db("RADIOSONDEO",$link);
for ($i=0;$i<=count($existe);$i++){
if (isset($$existe[$i])){
echo "estos son los registros seleccionados <br>";
echo $$existe[$i]."<br>";
$mata =("delete from $nombre where id = $$existe[$i]");
mysql_query($mata,$link);
}
}
?>
pero no los elimina
que hice mal