Ver Mensaje Individual
  #1 (permalink)  
Antiguo 21/10/2010, 11:36
jhonjiboy
 
Fecha de Ingreso: octubre-2010
Ubicación: suba
Mensajes: 15
Antigüedad: 13 años, 6 meses
Puntos: 0
Consulta por rango de fechas

buenas tardes necesito un favor enorme de ustedes tengo una base de datos con una tabla llamada td_tickets con un campo date del cual quiero extraer un rengo de fechas digitado por el usuario de la siguiente forma

[IMG][URL=http://www.uploadfilesystem.com//viewimage.php?file=/imagenes/10/10/21/MT480567.gif][IMG]http://www.uploadfilesystem.com/thumbs/10/10/21/tn_MT480567.jpg[/IMG][/URL][/IMG]

como se puede observar el usuario me digita una fecha de inicio y una fecha final la cual al momento de oprimir el boton buscar me tiene que extraer todos los datos comprendidos entre estas dos fechas.

pero al darle buscar me aparce lo siguiente:

[IMG][URL=http://www.uploadfilesystem.com//viewimage.php?file=/imagenes/10/10/21/lhB81262.jpg][IMG]http://www.uploadfilesystem.com/thumbs/10/10/21/tn_lhB81262.jpg[/IMG][/URL][/IMG]



por favor necesito saber lo que tengo mal eh aqui el codigo del formulario y del scrip para extraer los datos

FORMULARIO

<FORM METHOD=POST ACTION="fechaESTAFETA.php">
fecha inicio: <INPUT TYPE="text" NAME="fecha1">fecha fin:<INPUT TYPE="text" NAME="fecha2">
<input type="submit" name="buscar" value="buscar">
</FORM>

EXTRAER DATOS

<?php

$link = mysql_connect("localhost", "root", "");
mysql_select_db("helpdesk",$link)or die ("Verifique la Base de Datos");
$fechaini=fecha1;
$fechafin=fecha2;
$result= mysql_query("SELECT * FROM td_tickets WHERE dname LIKE '%ESTAFETA%' AND date >= '07-sep-2010' AND date <= '09-sep-2010'")or die( mysql_error() );

if($row= mysql_fetch_array($result)){


echo "<table border= '3'\n";
echo "<tr> \n";
echo "<td><b>id</b></td> \n";
echo "<td><b>dname</b></td> \n";
echo "<td><b>mname</b></td> \n";
echo "<td><b>amname</b></td> \n";
echo "<td><b>email</b></td> \n";
echo "<td><b>subject</b></td> \n";
echo "<td><b>message</b></td> \n";
echo "<td><b>date</b></td> \n";
echo "<td><b>close_reason</b></td> \n";
echo "</tr> \n";
do{
echo "<tr> \n";
echo "<td>".$row["id"]."</td> \n";
echo "<td>".$row["dname"]."</td> \n";
echo "<td>".$row["mname"]."</td> \n";
echo "<td>".$row["amname"]."</td> \n";
echo "<td>".$row["email"]."</td> \n";
echo "<td>".$row["subject"]."</td> \n";
echo "<td>".$row["message"]."</td> \n";
echo "<td>".date("d-M-Y H:m:s ",$row["date"])."</td> \n";
echo "<td>".$row["close_reason"]."</td> \n";
echo "</tr> \n";
//id,dname,mname,amname,email,subject,message,date


}while ($row = mysql_fetch_array($result));

}else{
echo "¡ La base de datos está vacia !";
}

?>

POR FAVOR NECESITO DE SU AYUDA