Start by fixing the
SQL Injection[
^] vulnerability in your code.
Then change your output code to display each post within its own styled element, rather than putting everything within a single
<p>
tag.
<style>
article.post {
border: 3px solid black;
}
</style>
<?php foreach ($text as $texts) {
echo '<article class="post">';
echo implode(',', $text);
echo '</article>';
}?>