<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Documento sin t&iacute;tulo</title>
</head>

<body>
<p>CLICK PARA ELIMINAR LOS QUE NO SEAN INCONTABLES DE LA TABLA</p>
<form id="form1" name="form1" method="post" action="main.php?a=253&e=y">
  <input type="submit" name="button" id="button" value="ELIMINAR" />
</form>
<?php
if (isset($_GET['e']))
{
	$cons="SELECT clave FROM productos WHERE clasificacion <> 'Incontables'";
	$res=mysql_query($cons,$conex) or die (mysql_error());
	while($fila=mysql_fetch_row($res))
	{
		//echo $fila[0]."<br>";
		$cons2="DELETE FROM incontables WHERE idProducto='$fila[0]'";
		$res2=mysql_query($cons2,$conex) or die (mysql_error());
	}
	echo "Total: ".mysql_num_rows($res)." Eliminados<br>";	
	/*
	if (mysql_num_rows($res)==0)
	{
		echo "<br> NO ES NECESARIO ELIMINAR";
	}
	*/
}
?>
<p>&nbsp; </p>
</body>
</html>
