lundi 2 novembre 2015

sqlite_fetch_object() is undefined

I am trying to implement a sqlite data layer for an assignment for a class. in the mysqli layer, I used mysqli_fetch_object with no issues. I am trying to do the same thing with sqlite, but it comes with an error saying it is an undefined method. This is the method that is using fetch_object:

public function selectActor($actorId)
{
    $this->stmt = @$this->dbConnection->prepare("SELECT * FROM actor WHERE actor_id = :actorid");
    $this->stmt->bindParam(':actorid', $actorId, PDO::PARAM_INT);
    $this->stmt->execute();

if (!$this->stmt) {
    die('Could not retrieve records from the Sakila Database: ' .
        $this->dbConnection->error);
}
$return = sqlite_fetch_object($this->stmt);

return $return;//returns object
}

Aucun commentaire:

Enregistrer un commentaire