implementing DB Class
public php v1 · immutable<?phpfunction __autoload($classname) { require_once('includes/'.$class_name.'.class.php'); }class news { function __toString() { print '<div id="'.$this->id.'"><h1>'.$this->title.'</h1> by <i>'.$this->author.'</i>'; print '<br />'; print '<pre>'.$this->body.'</pre></div>'; }}$db = new DB();$news = $db->execute('SELECT * FROM news');$news->handler('news');foreach($news as $post) print $post;?>