public static function addCategory(Base_PDO $_dbh, $name) { $_dbh->query("INSERT INTO category (`subject`) VALUES (?)", array($name)); $id = $_dbh->lastInsertId(); self::$categories[$id] = $name; return intval($id); }
public static function addAuthor(Base_PDO $_dbh, $name) { $_dbh->query("INSERT INTO author (name_full) VALUES (?)", array($name)); $id = $_dbh->lastInsertId(); self::$authors[$id] = $name; return intval($id); }