Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?
- $sql = mysql_query("select p.id, p.image1, p.image2, p.image3, p.image4, p.name, p.text, p.price, p.org_price, p.delivery, p.guide, p.wash_degree, p.wash_dry, p.wash_iron, p.wash_dryclean, p.wash_bleach, p.url_title, b.logo, b.url, b.url_title as brand_title, b.name as brand_name, b.id as brand_id, sum(s.amount) as stock, c.time_start, c.time_end, (select round((org_price-price)/org_price*100,0) as perc from products where id=p.id order by perc desc limit 1) as percentage from products as p inner join brands as b on p.brand=b.id left join stock as s on s.p_id=IF(p.common_id=0, p.id, p.common_id) left join campaigns as c on p.campaign=c.id where p.front='1' and p.status='1' and p.url_title='".$name."' and b.url_title='".$brand."' and (p.campaign != 0 and p.campaign is not null) group by s.p_id limit 1") or die(mysql_error());
- ?>
Add Comment
Please, Sign In to add comment