diff options
| author | Carson Fleming <cflems@cflems.net> | 2017-03-09 00:28:02 -0500 |
|---|---|---|
| committer | Carson Fleming <cflems@cflems.net> | 2017-03-09 00:28:02 -0500 |
| commit | a44a0e047a7582fe7e31743e1b03a17cf2987f73 (patch) | |
| tree | 1bb28593eb493cac175f2ed42ab108a4248e1ec1 /dash/ads.php | |
| parent | f75fc7b47735ed73535478e4d70e62694247a586 (diff) | |
| download | bulletin-a44a0e047a7582fe7e31743e1b03a17cf2987f73.tar.gz | |
Created the ability to post ads, rating framework
Diffstat (limited to 'dash/ads.php')
| -rw-r--r-- | dash/ads.php | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/dash/ads.php b/dash/ads.php index 7187f86..46ebe25 100644 --- a/dash/ads.php +++ b/dash/ads.php @@ -6,7 +6,7 @@ $adid = intval($_GET['id']); if ($adid < 1) fatal('No ad ID has been provided. You must have reached this page in error.'); $title = 'Ad / Bulletin'; require('header.php'); -$result = $db->query('SELECT ads.id, ads.uid, ads.title, ads.pay, ads.time, ads.location, ads.description, users.name, users.email, users.phone, users.picture, users.bio, 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 dash_fatal($db->error); +$result = $db->query('SELECT ads.id, ads.uid, ads.title, ads.pay, ads.time, ads.location, ads.description, users.name, users.email, users.phone, users.picture, users.bio, 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.' GROUP BY ads.id LIMIT 1') or dash_fatal($db->error); if ($result->num_rows < 1) dash_fatal('No ad with this ID has been found.'); $row = $result->fetch_assoc(); $result->free(); |
