Ver Mensaje Individual
  #1 (permalink)  
Antiguo 28/05/2015, 10:43
javibs
 
Fecha de Ingreso: abril-2015
Ubicación: Madrid
Mensajes: 14
Antigüedad: 9 años
Puntos: 0
ERROR: Fatal error: Call to a member function fetchAll() on non object

Que ocurre al código

Código PHP:
<?php
try {
    
$bd = new PDO("localhost;dbname=u355977389_1","u355977389_1","123456");
    
$bd->query("SET NAMES 'utf8'");
} catch (
Exception $e){
    echo 
"No se ha podido conectar";
    exit;
}
try{
    
$resultado=$bd->query("SELECT id, titulo, imagen FROM circuito ORDER BY id");
}catch(
Exception $e){
    echo 
"Error en consulta";
    exit;
}

$circuits $resultado->fetchAll(PDO::FETCH_ASSOC);
?>
ERROR: Fatal error: Call to a member function fetchAll() on a non-object on line 16


Muchas gracias por ayudar.