<?php
class people extends db {
function load($id=-1) {
$where = '';
if($id!=-1) $where = "where id=".(int)$id;
try {
if(!self::$dbh) $this->connect();
$result = self::$dbh->query("SELECT * FROM people $where");
$rows = $result->fetchAll(PDO::FETCH_ASSOC);
} catch (PDOException $e) {
$this->fatal_error($e->getMessage());
}
return $rows;
}
?>