$dbh = new PDO('mysql:dbname=database;host=localhost', 'usr', 'password');
$sth = $dbh->query("SELECT id, content FROM posts WHERE visibility = '1'");
$sth->execute();
$posts = $sth->fetchAll(PDO::FETCH_ASSOC);
Манипуляции c content
$res = $dbh->prepare("UPDATE posts SET content = $content WHERE id = $id");
if ($res === FALSE) {
echo mysqli_error($dbh) . PHP_EOL;
} else {
echo "Пост - " . $id . PHP_EOL;
}