create table posts (
id int auto_increment primary key,
author varchar(255),
post text
);
insert into posts(author, post) values
('rozhnev', 'Online PHP & SQL sandbox');
<?php
$postId = 1;
$author = 'rozhnev';
$mysqli_statement = $mysqli->prepare('SELECT * FROM posts WHERE id = ? and author = ?');
$mysqli_statement->bind_param('ds', $postId, $author);
$mysqli_statement->execute();
$result = $mysqli_statement->get_result(); // get the mysqli result
$post = $result->fetch_assoc(); // fetch data
var_dump($post);