pclip
public text v1 · immutable public function get(&$catobj){
if (!isset($this->statements['get']))
$this->statements['get'] = parent::prepare("SELECT title, description FROM categories WHERE id = ?");
$this->statements['get']->bindParam(1, $catobj->getId());
$this->statements['get']->execute();
$row = $this->statements['get']->fetch(PDO::FETCH_ASSOC);
$catobj->setTitle($row['title']);
$catobj->setDescription($row['description']);
}