query('SELECT ads.title, ads.pay, ads.time, ads.location, ads.description, users.name, users.email, users.phone, users.picture, SUM(ratings.stars) / COUNT(ratings.stars) AS rating FROM ads INNER JOIN users ON users.id = ads.uid LEFT JOIN ratings ON ratings.rated = ads.uid WHERE ads.id = '.$adid.' LIMIT 1') or fatal($db->error); if ($result->num_rows < 1) fatal('No ad with this ID has been found.'); $row = $result->fetch_assoc(); ?>
Pays =number_format($row['pay'], 2);?>
=date('g:i a', intval($row['time'])).' on '.date('M j, Y', intval($row['time']));?> at =htmlentities($row['location']);?>
=htmlentities($row['description']);?>