Code:
"SELECT a.artist_id,a.artist_name,a.is_feat,a.a_fid,a.a_fname,a.the,c.record_id,c.code,c.chart,c.pos,c.last,c.pos-c.last as calc
,c.label,c.c_sales,r.r_rating,r.r_votes,r.r_title,r.r_record_id,r.r_lyric_id,r.num_discs,r.r_comments,r.r_cover_id,r.r_no_coms
,r.r_re,r.r_ri,r.r_wks,r.r_charted,r.r_status,r.r_pk,r.r_sales,r.r_sales_added,r.r_analist,r.r_type
,p.pic_linked,p.pic_id,p.pic_small,d.gallery_pic_id,l.a_id as lead_artist,an.an_current,an.an_list,an.an_list1,an.an_list2,an.an_list3
FROM ibf_charts c
INNER JOIN ibf_artists a ON (a.artist_id = c.artist_id)
INNER JOIN ibf_records r ON (r.r_record_id = c.record_id)
LEFT JOIN ibf_update_analysis an ON (an.an_chart_id = c.dj_id)
LEFT JOIN ibf_artists_and_records l ON (l.r_id = c.record_id AND l.lead=1)
LEFT JOIN ibf_record_discs d ON (d.record_id = r.r_record_id)
LEFT JOIN ibf_gallery_pics p ON (p.pic_id = d.gallery_pic_id)
WHERE {$tz}c.code = '" . $this->this_week . "' AND c.chart = '" . $chi . "'{$tp} LIMIT $p,$perpage"
$tp is the Grouping and ordering set depending on the request and $tz may be an NOT IN (Clause) Again depending on the users request i.e show droupouts from last weeks charts.
Bookmarks