1){ ?> 0 order by o.id desc limit 0,1"; } else { // for getting default offer product type $offer_query="select SQL_CACHE m.oid,m.id,m.prod_code,o.id,o.type,o.offer_img from master_offer_products as m,offer_types as o,vendors_product_master vpm,site_vendors sv where o.status=1 and m.id=o.id and m.website_code='$int_websitecode' and vpm.vp_procode=m.prod_code and vpm.vp_status=1 and sv.website_code='$int_websitecode' and sv.vendor_code=m.vendor_code and sv.status=1 and vpm.vp_vendorcode=m.vendor_code and vpm.vp_proquantity>0 group by o.display_order,o.id desc limit 0,1"; } $str_defaultoffer=NULL; $offer_res1=mysql_query($offer_query); while($offer_row1=mysql_fetch_array($offer_res1)) { $int_defaultoffer=$offer_row1['id']; //storing the present id in a session $_SESSION['int_offerid']=$int_defaultoffer; $str_defaultoffer=$offer_row1['type']; } // for display Home Products $qur="select SQL_CACHE m.oid,m.id,m.prod_code,o.id,o.type,o.offer_img from master_offer_products as m,offer_types as o,vendors_product_master vpm,site_vendors sv where o.status=1 and m.id=o.id and m.website_code='$int_websitecode' and m.id='$int_defaultoffer' and m.status=1 and vpm.vp_procode=m.prod_code and vpm.vp_status=1 and sv.website_code='$int_websitecode' and sv.vendor_code=m.vendor_code and sv.status=1 and vpm.vp_vendorcode=m.vendor_code and vpm.vp_proquantity>0 group by o.id order by type"; $res=mysql_query($qur); $row=mysql_fetch_array($res); ?>
Loading