I have been trying to pull all infomation where $user is equal to subscriberID in my sql database. I am using the PDO method of inserting data and wish to use the query function also. i am getting the following error message back from my try condition.
Fatal error: Call to a member function setFetchMode() on a non-object
I have considered maybe the problem has been caused by the method i use to pull the data as im fairly new to PDO.(i include a top.php that establishes the link to the database)
Thank you for your suggestions
 <?php
 include "top.php";
    try{
        $user = $_SESSION['login'];
        echo "Welcome <strong>$user</strong> to your saved holidays";
        //$getSavedHolidays = $db->query("SELECT * FROM saved_holidays WHERE subscriberID='$user'");
        //preparing a PDO statment for accessing saved holidays when the logged in user matchs the subscriberID
        $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
        $db->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);
        $getSavedHolidays = $db->prepare("SELECT * FROM saved_holidays WHERE subscriberID=:user");
        //uses a bind valu as this makes the statment more secure
        $getSavedHolidays->bindValue(":user", $_SESSION['login']);
        $getsavedHolidays->setFetchMode(PDO::FETCH_ASSOC);
        $getSavedHolidays->execute();
        foreach ($Result as $row)
            {
                echo "<p><a href'".$row['link']."'>".$row['title']."</a><br \>" . 
                     $row['description'] . "<br \>" . 
                     $row['pubDate'] ."<br \></p>";
            }
        }
        catch (PDOException $e) 
            {
                 print_r($e->errorInfo);
                    die();
            }
?>
 
     
    