我该如何结合这个:
$raw_results = mysql_query("SELECT `item`, (`totalrate` / `nrrates`) AS `rank` FROM `rtgitems` ORDER BY (`totalrate` / `nrrates`) DESC LIMIT 5") or die(mysql_error());
用这个?
INNER JOIN vouchers ON vouchers.item = rtgitems.item
由于
答案 0 :(得分:0)
将其连成一个查询:
$raw_results = mysql_query("SELECT rtgitems.item, (totalrate / nrrates) AS rank
FROM rtgitems
INNER JOIN vouchers ON vouchers.item = rtgitems.item
ORDER BY (totalrate / nrrates)
DESC LIMIT 5")
or die(mysql_error());