Ver Mensaje Individual
  #19 (permalink)  
Antiguo 22/10/2015, 14:57
pips
 
Fecha de Ingreso: octubre-2011
Mensajes: 104
Antigüedad: 14 años, 11 meses
Puntos: 1
Respuesta: Problema enviar variables desde href

Hola rbczgz muchas gracias por responder
he colocado el codigo así:
Código PHP:
if ( isset($_GET['foo']) && !empty($_GET['foo']) ) {
$foo = $_GET['foo'];
} else {
$foo = "";
}
class 
Helper{  
public 
$foo;  
public function 
get_resultados($foo){ 
            global 
$foo;     
            
$this->dbh = new Conexion();
            
$offset = 0; 
            
$limit = 30; 
            
$sql = "SELECT imagen,precio FROM ropa";  
            
$sql = $sql. " WHERE codigo = ? ";  
            
$sql = $sql. " ORDER BY precio ASC ";  
            
$sql = $sql. " LIMIT ?,? ";  
            
$query = $this->dbh->prepare($sql);  
            
$query->bindValue(1, $foo, PDO::PARAM_STR);               
            
$query->bindValue(2, (int) $offset, PDO::PARAM_INT);   
            
$query->bindValue(3, (int) $limit, PDO::PARAM_INT);               
            
$query->execute();   
            if(
$query->rowCount() > 0)  
            {                   
                 return 
$query->fetchAll(PDO::FETCH_ASSOC);      
            }}
} 
console.log(data); me devuelve: {"prdcts":null} no imprime nada.... lo he vuelto a rehacer y nada...

Muchas gracias por responder y un saludo