<?php 

$dir = '../';

require_once $dir.'includes/main.php';

$offset = (int)$_POST['offset'];

$sql = "SELECT * FROM listings WHERE user_id = '{$user_id}' ORDER BY points DESC LIMIT $offset, {$per['listings']}";

$offset = $offset + 1;

fetch_elements($sql, 'elements/listings/main.php', 'x', $offset);

?>