<code lang="php">
Array
(
[661] => Array
(
[w_id] => 30557
[up] => 3580
[name_t] => Водолазка женская
[name_g] => KTL 190616
)
[662] => Array
(
[w_id] => 30556
[up] => 3580
[name_t] => Водолазка женская
[name_g] => KTL 190616
)
[663] => Array
(
[w_id] => 30555
[up] => 3580
[name_t] => Водолазка женская
[name_g] => KTL 190616
)
[664] => Array
(
[w_id] => 30560
[up] => 3580
[name_t] => Водолазка женская
[name_g] => KTL 190617
)
[665] => Array
(
[w_id] => 30558
[up] => 3580
[name_t] => Водолазка женская
[name_g] => KTL 190617
)
[666] => Array
(
[w_id] => 30559
[up] => 3580
[name_t] => Водолазка женская
[name_g] => KTL 190617
)
[667] => Array
(
[w_id] => 30561
[up] => 3580
[name_t] => Водолазка женская
[name_g] => KTL 190618
)
[668] => Array
(
[w_id] => 30562
[up] => 3580
[name_t] => Водолазка женская
[name_g] => KTL 190618
)
[669] => Array
(
[w_id] => 30564
[up] => 3580
[name_t] => Водолазка женская
[name_g] => KTL 190618
)
[670] => Array
(
[w_id] => 30563
[up] => 3580
[name_t] => Водолазка женская
[name_g] => KTL 190618
)
[671] => Array
(
[w_id] => 30675
[up] => 3580
[name_t] => Водолазка женская
[name_g] => KTL 190622
)
[672] => Array
(
[w_id] => 30676
[up] => 3580
[name_t] => Водолазка женская
[name_g] => KTL 190622
)
)
</code>
$arr1 = array(1,2,4,5,7);
$arr2 = range(1,max($arr1));
$missing = array_diff($arr2,$arr1); // (3,6)
DELIMITER $$
CREATE DEFINER=`root`@`%` PROCEDURE `sync_fl`()
BEGIN
DECLARE exit handler for sqlexception
BEGIN
-- ERROR
ROLLBACK;
END;
DECLARE exit handler for sqlwarning
BEGIN
-- WARNING
ROLLBACK;
END;
START TRANSACTION;
CREATE DEFINER=`root`@`%` PROCEDURE `sync_fl`()
BEGIN
DROP TABLE IF EXISTS `sh_prod_im__`;
ALTER TABLE `sh_prod_im` RENAME TO `sh_prod_im__`;
ALTER TABLE `sh_prod_im_` RENAME TO `sh_prod_im`;
COMMIT;
END$$
DELIMITER ;
Данный пример делает практически как мне нужно, но я хотел бы увидеть пример как это сделать через array_filter.