<?php
// $mysqli is already declared as a working database connection by this sandbox
$sql = <<<SQL
SELECT *
FROM new_messages
WHERE username='Bashir'
SQL;
$obj = $mysqli->query($sql);
var_export([
'total' => $obj->num_rows,
'data' => $obj->fetch_all(MYSQLI_ASSOC)
]);