SELECT pa_ContactID,t_ContactName FROM Profiles as P INNER JOIN Categories_ContactsCategories AS CC ON ( CC.pi_contactID = pa_ContactID AND (pi_CategoryID in (399,647) OR pi_CategoryID IN (SELECT pa_CategoryID FROM Categories WHERE pi_ParentID in (399,647)) )) where P.b_Deleted=0 and P.b_Completed=1 and b_featured=0 and ( (t_picsFolder='place' and b_Status=1) OR (t_picsFolder!='place') ) and ( (t_picsFolder='event' and pa_ContactID in (select pi_ContactID FROM Profiles_Events WHERE pi_ContactID=pa_ContactID and ((d_EndDate='0000-00-00') Or (d_EndDate ='2014-04-16' and (d_EndTime >= '08:00:00' OR d_EndTime ='00:00:00')) OR (d_EndDate >'2014-04-16')) and NotImportant=0)) OR (t_picsFolder!='event') ) and ( (t_picsFolder='movie' and 1 in (select b_PlayingNow FROM Profiles_Movies WHERE pi_MovieID=pa_ContactID))OR (t_picsFolder!='movie') ) and b_closed=0 and pa_ContactID not in (15756,15755,15754) group by pa_ContactID order by pa_ContactID desc
Lebanon in Photos: See Pictures of the Incredible Sights and Events Happening in Lebanon :: :: Beirut City Guide