mardi 1 septembre 2015

SQLite PDO fetches blank array though table has records

I used the following code to fetch the record. It displays Array ( ) Please look into the code

try {
    if($this->odb == NULL) {
        $this->odb = new PDO( 'sqlite:/home/dev/sqlite/gd_lcl_ds');
    }
} catch {
    echo $e->getMessage();
}

$statement = $this->odb->prepare('select * from employee');

try{
    $statement->execute();
} catch (PDOException $e) {
    echo $e->getMessage();
}

$result = $statement->fetchAll();
print_r($result);

Aucun commentaire:

Enregistrer un commentaire