$q1=mysql_query("SELECT id,price,group_id,name,description FROM `product` LIMIT 0, 200");
$q2=mysql_query("SELECT id,parent_id,name FROM `product_group` LIMIT 0, 200");
$q3=mysql_query("SELECT file FROM `product_image` ORDER BY `product_image`.`product_id` ASC LIMIT 0, 200");
select p.*, p_g.*, p_i.*
from `product` p
left join `product_group` p_g ON p_g.id = p.group_id
left join `product_image` p_i ON p_i.product_id = p.id
ORDER BY p_i.`product_id` ASC
LIMIT 0, 200
$ymlcontent.="<offer id=\"".$row['id']."\" available=\"true\">\n";
$ymlcontent.="<url>http://www.site.ru/product/view/id/".$row['id']."</url>\n";
$ymlcontent.="<price>".$row['price']."</price>\n";
$ymlcontent.="<currencyId>RUR</currencyId>\n";
$ymlcontent.="<categoryId>".$row['group_id']."</categoryId>\n";