class Model {
public function getAllArticles(){
$dbh = new PDO($dsn, $user, $pass);
$query = "SELECT * FROM my_table";
return $dbh->query($query);
}
public function save($title, $article){
$dbh = new PDO($dsn, $user, $pass);
$query = "INSERT INTO my_table (title, article) VALUES ('$title', '$article')";
$dbh->query($query);
}
}