Ver Mensaje Individual
  #4 (permalink)  
Antiguo 22/02/2011, 11:50
walterdevel
 
Fecha de Ingreso: diciembre-2010
Mensajes: 788
Antigüedad: 13 años, 4 meses
Puntos: 51
Respuesta: Select no me selecciona

Cita:
Iniciado por bUllan9ebrio Ver Mensaje
Compa hace esto :

Código PHP:
Ver original
  1. $myQuery = "SELECT habitacion.id_habitacion, nombre, descricion, ocupacion_maxima, tarifa ";
  2.     $myQuery =     $myQuery . " FROM habitacion, Reserva ";
  3.     $myQuery = $myQuery . " WHERE habitacion.id_habitacion = Reserva.id_habitacion ";
  4.     $myQuery = $myQuery . " AND ocupacion_maxima >= " . $_POST["adultos"] ;
  5.     $myQuery = $myQuery . " AND fecha_entrada >= '" . $_POST["fecha_entrada"] . "' ";
  6.     $myQuery = $myQuery . " AND fecha_salida <= '" . $_POST["fecha_salida"] . "' ";
  7.     $myQuery = $myQuery . " GROUP BY id_habitacion, nombre, descricion, ocupacion_maxima, tarifa ";
  8.     $myQuery = $myQuery . " HAVING count(*) > 0 ";
  9.     $myQuery = $myQuery . " ORDER BY ocupacion_maxima asc, tarifa desc ";
  10.  
  11. echo $myQuery;

Luego pruebalo directo en la base de datos
Sos mi eco? XDD

PD: bromita :P