Ver Mensaje Individual
  #4 (permalink)  
Antiguo 08/09/2010, 12:25
maxiweb
 
Fecha de Ingreso: mayo-2010
Mensajes: 7
Antigüedad: 14 años
Puntos: 0
Respuesta: Select con Between no funciona

<?php //tuconecttion ?>
<?php

if ((isset($_POST["MM_consul"])) && ($_POST["MM_consul"] == "form1")) {

$SQL = sprintf("SELECT COUNT(edad) as cedad, edad FROM usuario_principal WHERE fecha BETWEEN ('".$_POST['fechaini']."') AND ('".$_POST['fechafin']."') GROUP BY edad;");,


mysql_select_db($tubasededatos, $tuconexion);
$Result1 = mysql_query($SQL, $siso) or die(mysql_error());
}




?>

<!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>
<form id="form1" name="form1" method="post" action="">
<label>fehca ini
<input type="text" name="fechaini" />
</label>
fecha fin
<input type="text" name="fechafin" />
<input type="hidden" name="MM_consul" value="form1">
</form>
</body>
</html>