achyorny
Новичок
можно ли это:
заменить этим:
?
PHP:
$result = $this->db->query("SELECT * FROM product_to_store WHERE `product_id` NOT IN (SELECT `product_id` FROM product)");
foreach ($result->rows as $item)
$this->db->query( "DELETE FROM product_to_store WHERE `product_id` ='".(int)$item['product_id']."'" );
PHP:
$this->db->query( "DELETE FROM product_to_store WHERE `product_id` NOT IN (SELECT `product_id` FROM product)" );