require_once 'app/Mage.php';
Mage::app('default');
$write = Mage::getSingleton('core/resource')->getConnection('core_write');
$readresult=$write->query("SELECT product_id, category_id FROM catalog_category_product ORDER BY product_id");
while ($row = $readresult->fetch() ) {
$write2 = Mage::getSingleton('core/resource')->getConnection('core_write');
$readresult2=$write2->query("SELECT sku FROM catalog_product_entity WHERE entity_id = ".$row['product_id']." LIMIT 1");
while ($row2 = $readresult2->fetch() ) {
$sku = $row2['sku'];
}
".$sku." echo $row['product_id']."
";
}
Mage::app('default');
$write = Mage::getSingleton('core/resource')->getConnection('core_write');
$readresult=$write->query("SELECT product_id, category_id FROM catalog_category_product ORDER BY product_id");
while ($row = $readresult->fetch() ) {
$write2 = Mage::getSingleton('core/resource')->getConnection('core_write');
$readresult2=$write2->query("SELECT sku FROM catalog_product_entity WHERE entity_id = ".$row['product_id']." LIMIT 1");
while ($row2 = $readresult2->fetch() ) {
$sku = $row2['sku'];
}
".$sku." echo $row['product_id']."
";
}