ExecuteS(' SELECT `id_product` FROM `'._DB_PREFIX_.'product_ps_cache` WHERE `id_sale` > 2500 AND `id_sale` < 3500 -- AND `id_product` < 100000 ') as $row) { $id_product[] = (int) $row['id_product']; } echo count($id_product)."\n\n"; foreach(Db::getInstance()->ExecuteS(' SELECT * FROM `'._DB_PREFIX_.'image` WHERE `id_product` IN ('.implode(', ', $id_product).') -- AND `id_product` NOT IN (23606, 3522, 23607, 24483, 11752, 35837, 85644, 124519, 269752) ') as $row) { $folder = Image::getImgFolderStatic((int) $row['id_image']); unlink(dirname(__FILE__).'/www/img/p/'.$folder.(int) $row['id_image'].'-thickbox.jpg'); unlink(dirname(__FILE__).'/www/img/p/'.$folder.(int) $row['id_image'].'-small.jpg'); unlink(dirname(__FILE__).'/www/img/p/'.$folder.(int) $row['id_image'].'-medium.jpg'); unlink(dirname(__FILE__).'/www/img/p/'.$folder.(int) $row['id_image'].'-large.jpg'); unlink(dirname(__FILE__).'/www/img/p/'.$folder.(int) $row['id_image'].'-home.jpg'); // unlink(dirname(__FILE__).'/www/img/p/'.(int) $row['id_product'].'-'.(int) $row['id_image'].'-thickbox.jpg'); // unlink(dirname(__FILE__).'/www/img/p/'.(int) $row['id_product'].'-'.(int) $row['id_image'].'-small.jpg'); // unlink(dirname(__FILE__).'/www/img/p/'.(int) $row['id_product'].'-'.(int) $row['id_image'].'-medium.jpg'); // unlink(dirname(__FILE__).'/www/img/p/'.(int) $row['id_product'].'-'.(int) $row['id_image'].'-large.jpg'); // unlink(dirname(__FILE__).'/www/img/p/'.(int) $row['id_product'].'-'.(int) $row['id_image'].'-home.jpg'); if((int) $row['id_product'] % 200 == 0) { echo $row['id_product']."\n"; } }