I'm trying to add some data to my database, but I'm getting the error Catchable fatal error: Object of class PDOStatement could not be converted to string in /var/www/mandje.php on line 114.
This is the code I'm using:

```
 foreach($_SESSION["cart"] as $id => $value){

        $query = $db->query('SELECT * FROM Producten WHERE ProductID ="'.$id.'" ');
        $query->execute();

        while($row = $query->fetch(PDO::FETCH_ASSOC)){
            $price = $row['Prijs'];
            $ProductID = $row['ProductID'];
            }
        $sql="INSERT INTO Bestellingsdetail( Bestelnummer, ProductID, Aantal, Prijs)
        VALUES ($max,$ProductID,$value,$price)";      //<---- line 114
        $count = $db->execute($sql);

```

I don't really get what's going wrong here. Any help would be much appreciated :)