hola buenas tardes amigos del foro, recurro a ustedes esta vez para su ayuda con lo siguiente.
necesito eliminar registros de una tabla de mysql que se encuentren entre dos fechas, para ello ya tengo el buscador con fecha inicial y fecha final, ahi mismo me muestra la lista de registros que cumplen esa consulta dentro de un form , cada registro tiene un checkbox que envia el id de cada registro.
hasta ahi todo bien pero no se que hacer de ahi en adelante no se nada de php y lo que hago es gracias al DREAMWEAVER CS4, he leido mucho por internet algunas posibles rutinas para el scrip de la pagina de eliminacion pero no logro entender y no me sale nada.
de antemano gracias por su valiosa ayuda
ESTE ES MI CODIGO
Código PHP:
Ver original<?php require_once('Connections/conbanca.php'); ?>
<?php
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
}
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ?
intval($theValue) : "NULL"; break;
case "double":
$theValue = ($theValue != "") ?
doubleval($theValue) : "NULL"; break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
$colname_Recordset1 = "-1";
if (isset($_GET['busca1'])) { $colname_Recordset1 = $_GET['busca1'];
}
$colname2_Recordset1 = "-1";
if (isset($_GET['busca2'])) { $colname2_Recordset1 = $_GET['busca2'];
}
$query_Recordset1 = sprintf("SELECT * FROM inmuebles WHERE fecha BETWEEN %s AND %s", GetSQLValueString
($colname_Recordset1, "date"),GetSQLValueString
($colname2_Recordset1, "date")); ?>
<!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=utf-8" />
<title>Documento sin título</title>
</head>
<body>
<form id="form1" name="form1" method="get" action="masivo1.php">
Fecha del
<label for="busca1"></label>
<input type="text" name="busca1" id="busca1" />
al
<label for="busca2"></label>
<input type="text" name="busca2" id="busca2" />
<label for="button"></label>
<input type="submit" name="button" id="button" value="Enviar" />
</form>
<p> </p>
<hr />
<p> </p>
<form action="masivo2.php" method="post" name="form2" id="form2">
<table width="40%" border="0" cellspacing="0" cellpadding="3">
<tr>
<td bgcolor="#D6D6D6">ID</td>
<td bgcolor="#D6D6D6">CODIGO INMUEBLE</td>
<td bgcolor="#D6D6D6">CODIGO METRO</td>
<td bgcolor="#D6D6D6">USUARIO</td>
<td bgcolor="#D6D6D6"> </td>
</tr>
<?php do { ?>
<tr>
<td><?php echo $row_Recordset1['id']; ?></td>
<td><?php echo $row_Recordset1['codigo_inm']; ?></td>
<td><?php echo $row_Recordset1['Cod_Metro']; ?></td>
<td><?php echo $row_Recordset1['usuario']; ?></td>
<td><input name="campos[]" type="checkbox" value="<?php echo $data['id']; ?>" />
<label for="idcat[]"></label></td>
</tr>
</table>
<p>
<label for="button2"></label>
<input type="submit" name="button2" id="button2" value="ELIMINAR" />
</p>
</form>
<p> </p>
</body>
</html>
<?php
?>