Ver Mensaje Individual
  #3 (permalink)  
Antiguo 02/07/2009, 12:15
Avatar de aldo1982
aldo1982
 
Fecha de Ingreso: noviembre-2004
Ubicación: Santa Fe (Argentina) Colon F.C
Mensajes: 1.362
Antigüedad: 20 años, 2 meses
Puntos: 6
Respuesta: como concateno en el where

Cita:
Iniciado por fbirrer Ver Mensaje
hola grupo
estoy haciendo una funcion a la cual le paso un parámetro, con este parámetro formo una consulta, pero no logro concatenar el string con la variable


asi lo tengo

Código PHP:
    function getMensaje(vId){
[
B][COLOR="Red"]        $sql='select pMensaje  from cus_empresa where empre_id=' id;
[/
COLOR][/B]        
        
/*Ejecutamos la query*/
        
$stmt=$bd->ejecutar($sql);
        
        
/*Realizamos un bucle para ir obteniendo los resultados*/
        
while ($x=$bd->obtener_fila($stmt,0)){
        echo 
$x['pMensaje'].'<br />';
        }
    
        return 
    } 
¿Como es la solucion?

Gracias

ah ahi vi mejor tu post, asi seria

$sql='select pMensaje from cus_empresa where empre_id=' . id.'';
__________________
LA MUERTE ESTÁ TAN SEGURA DE VENCER QUE NOS DA TODA UNA VIDA DE VENTAJA