(2013-06-07, 09:30 PM)Jambuster Wrote: [ -> ]Google "MYSQL Left Join"
I don't really understand that. :s
^ suggestion is to find MySQL codes related to LEFT JOIN for joining the tables and getting the query results
Example? here:
$query = $db->query("
SELECT t.tid, t.fid, t.subject, t.lastpost,
t.lastposter, t.lastposteruid, f.name,
u.usergroup, u.displaygroup
FROM ".TABLE_PREFIX."threads AS t
INNER JOIN ".TABLE_PREFIX."forums as f
ON (f.fid = t.fid)
LEFT JOIN " . TABLE_PREFIX . "users AS u
ON (t.lastposteruid = u.uid)
AND t.visible = '1'
GROUP BY t.tid");
Still not a scoobie what to do. :s
This will select every myawards_users row, then select every matching row from myawards with the same 'awutime' value. I don't know if this column is used in both, so you'd better go with using something like award uid or whatever (view in database which columns are same in both tables).
$query = $db->write_query("
SELECT * FROM ".TABLE_PREFIX."myawards_users AS ma_u
LEFT JOIN ".TABLE_PREFIX."myawards AS ma ON (ma_u.awutime = ma.awutime)
ORDER BY awutime DESC
LIMIT 25
");