$sql_golf_list = "select a.*,b.GolfCourse_Name,b.Address,b.City,b.Review,b.RefundPolicy,b.BankTransferDetail ,b.Rating,b.Lang,d.Province_Description as ProvinceName,f.Country_Description as CountryName,g.minprice from golfcourse a
left outer join golfcourse_details b on a.GolfCode=b.GolfCode
left outer join province c on a.Province_Id = c.Province_Id
left outer join province_details d on c.Province_Id = d.Province_Id
left outer join country e on a.Country_Id = e.Country_Id
left outer join country_details f on e.Country_Id = f.Country_Id
left outer join (select MIN(bb.Price) as minprice , aa.GolfCode from teetime_effective aa
left outer join greenfee bb on aa.EffectiveId=bb.EffectiveId group by aa.GolfCode)g on a.GolfCode=g.GolfCode
where a.enabled=1
and b.Lang='".$session_language."'
and d.Province_Lang='".$session_language."'
and f.Country_Lang='".$session_language."'
and (a.Province_Id='".$con_province."' or '".($con_province*1)."'=0)
and (a.GolfCode='".$con_golfname."' or '".($con_golfname*1)."'=0)
ORDER BY [enabled]";
$result_golf_list = DBQuery($sql_golf_list);
$r_golflist = mssql_fetch_array($result_golf_list);
Tag : MySQL, Ms SQL Server 2008, HTML/CSS, jQuery, CakePHP