
Code: Alles auswählen
$sql = "SELECT r.report_id, rr.reason_name, r.reporter_id, r.reporter_username, u.username AS reportername, r.report_time, r.report_status, r.report_last_edit_user_id, u2.username AS report_last_edit_username, r.report_last_edit_time
FROM " . REPORTS_TABLE . " r
LEFT JOIN " . USERS_TABLE . " u ON u.user_id = r.reporter_id
LEFT JOIN " . USERS_TABLE . " u2 ON u2.user_id = r.report_last_edit_user_id
LEFT JOIN " . REPORT_REASONS_TABLE . " rr ON rr.reason_id = r.report_reason
WHERE $status_sql
$auth_sql
ORDER BY $order_by_sql ";
if ( $page != -1 )
{
$sql .= "LIMIT $start, " . $board_config['report_per_page'];
}
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, "Error by getting reports.", "", __LINE__, __FILE__, $sql);
}