search partner displaying posts

//function for displaying posts
function get_posts(){

global $con;
if (isset($_GET['page'])){

$page = $_GET['page'];

$start_from = ($page-1) * $per_page;

$get_posts = "select * from posts ORDER by 1 DEC LIMIT $start_from, $per_page";

$run_posts = mysqli_query($con,get_posts);

while ($row_posts=mysqli_fetch_array($run_posts)){

$post_id = $row_posts['post_id'];
$post_title = $row_posts['post_title'];
$post_date = $row_posts['post_date'];
$user_id = $row_posts['user_id'];
$content = $row_posts['post_content'];

//getting the user who has posted the thread
$user = "select * from users where user_id='$user_id' AND posts='yes'";

$run_user = mysqli_query($con,$user);
$row_user = mysqli_fetch_array($run_user);
$user_name = $row_user['user_name'];
$user_image = $row_user['user_image'];

//now displaying all at once

echo"<div id='posts'>
<p><img src='user/user_images/$user_image' width='50' height='50'</p>
<h3><a href='user_profile.php?u_id=$user_id'>$user_name</a></h3>
<a href='single.php?post_id=$post_id' style='float:right;'><button>See Replies or Reply to This </button></div><br/>



include ("pagination.php");