$stmt = $pdo->prepare( 'SELECT id, title FROM posts WHERE author_id = ? AND published = ?' ); $stmt->execute([$authorId, 1]); $posts = $stmt->fetchAll(PDO::FETCH_ASSOC);