查詢我tryed做到這一點:如何從多2個表
$sql = "SELECT phpbb_users.user_id, phpbb_users.username, phpbb_users.user_colour, topic_poster, phpbb_topics.forum_id, phpbb_forums.forum_price
FROM phpbb_topics LEFT JOIN phpbb_forums ON phpbb_topics.forum_id = phpbb_forums.forum_id
LEFT JOIN phpbb_users ON phpbb_topics.topic_poster = phpbb_users.user_id WHERE phpbb_users.group_id = '55222'
OR phpbb_users.group_id = '55229'
OR phpbb_users.group_id = '55174'
GROUP BY phpbb_users.user_id ORDER BY phpbb_forums.forum_price DESC";
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
{
$template->assign_block_vars('earn', array(
'USER_ID' => $row['user_id'],
'USERNAME' => $row['username'],
'USER_COLOR' => $row['user_colour'],
'U_USER' => append_sid($phpbb_root_path . "memberlist." . $phpEx . "?mode=viewprofile&u=" . $row['user_id']),
'TOTAL_EARN' => $price,
'TOTAL_UPLOADS' => $total_price_singels+$total_price_albums,
'TOTAL_UPLOADS_LASTMONTH' => $total_upload_lastmonth,
'TOTAL_UPLOADS_MONTH' => $total_upload_month,
));
}
其無法正常工作.... 我需要查詢每個用戶檢查他有多少郵件寫信給各種論壇,每個論壇有不同的價格,然後得到我的價格,每個用戶已獲得通用
再次感謝。
什麼是您收到的錯誤信息?它如何「不工作」? – Charx