<?php
$w=$GLOBALS['db']->query("select 
l.long_description,
p.name,
p.code,
p.product_category_name 
from ecmproducts as p inner join ecmproduct_language as l on l.ecmproduct_id=p.id 
where 
p.deleted='0' and 
(l.long_description!='' or l.long_description is not null) and 
(l.language='PL' or l.language='pl') and 
p.product_active='1' and 
p.production!=1 and 
p.end_of_line!=1
order by p.product_category_name asc,p.code asc");
while($r=$GLOBALS['db']->fetchByAssoc($w)){
	echo "<div>
		".$r['code']."<br>
		".$r['name']."<br>
		".$r['product_category_name']."<br>
		".str_replace("&lt;","<",str_replace("&gt;",">",$r['long_description']))."
	      </div>
	      <br>";
}
?>