Ver Mensaje Individual
  #2 (permalink)  
Antiguo 20/06/2011, 01:49
Avatar de repara2
repara2
 
Fecha de Ingreso: septiembre-2010
Ubicación: München
Mensajes: 2.445
Antigüedad: 14 años, 4 meses
Puntos: 331
Respuesta: Problema con una consulta en php

Hola Sonia, las variables entre comillas simples no se expanden, puedes cambiar la sintaxis:


Código PHP:
Ver original
  1. $sql = 'Select RecB_Rec_Cod,Rec_Ori,Rec_Dest,RecB_Hora,RecB_Fecha,RecB_CupoUso
  2. From recorrido,recorridobus
  3. where Rec_Ori="$Origen"
  4. and Rec_Dest="$Destino"
  5. and Rec_Cod=RecB_Rec_Cod
  6. and RecB_Hora="$Horai"
  7. and RecB_Fecha="$fechai"';

o tambien:

Código PHP:
Ver original
  1. $sql = "Select RecB_Rec_Cod,Rec_Ori,Rec_Dest,RecB_Hora,RecB_Fecha,RecB_CupoUso
  2. From recorrido,recorridobus
  3. where Rec_Ori='{$Origen}'
  4. and Rec_Dest='{$Destino}'
  5. and Rec_Cod=RecB_Rec_Cod
  6. and RecB_Hora='{$Horai}'
  7. and RecB_Fecha='{$fechai}'";

Saludos,
__________________
Fere libenter homines, id quod volunt, credunt.