Ver Mensaje Individual
  #7 (permalink)  
Antiguo 17/06/2013, 02:15
taboacar
 
Fecha de Ingreso: octubre-2012
Ubicación: Pozuelo de Alarcón
Mensajes: 67
Antigüedad: 12 años, 4 meses
Puntos: 1
Respuesta: Problema con consulta en PHP

Buenas,

Te pongo el codigo pero ya adelanto que es muy similar al que ya puse en su momento.

Funcion con la query:

Código PHP:
Ver original
  1. public function get_crwb_request_date()
  2.         {
  3.             //$query = 'SELECT request_date FROM transport WHERE (request_date = (SELECT MAX(request_date) FROM transport WHERE (transport_type LIKE "crwb*")))';
  4.             $query = 'SELECT transport.request_date FROM transport WHERE (((transport.request_date) Is Not Null) AND ((transport.transport_ref) Like "CRWB*")) ORDER BY transport.request_date DESC';
  5.             try
  6.             {
  7.                 $result = $this->dbh->prepare($query);
  8.                 $result->execute();
  9.                 $rows = NULL;
  10.                 print_r($query);
  11.                 if ($result)
  12.                 {
  13.                     $rows = $result->fetchAll(PDO::FETCH_ASSOC);
  14.                     print_r($rows);
  15.                     $rows = $this->filter_rows($rows);
  16.                 }
  17.                 return $rows;
  18.             }
  19.             catch (PDOException $e)
  20.             {
  21.                 $this->fatal_error($e->getMessage());
  22.             }
  23.            
  24.         }


Siguo sin sacar la solcuion, podria ser algo de nomenclatura?

Muchas gracias

Un saludo