if(empty($errors) { .......
$comm = R::getAll('SELECT * FROM messages');
foreach ($comm as $key => $comment) {
$comment = "<div class ='show'><p>". $comment['username'] . "</p>
<p>". $comment['message'] . "</p>";
$comm_ip = "<p>". $comment['ip'] ."</p></div>";
}
$comments_info = array(
'message' => $comment,
'ip' => $comm_ip );
echo json_encode($comments_info);
exit;
}
}