SELECT *
FROM (
SELECT `at`.`id_article` AS `id_article`, COUNT(*) AS `count`
FROM `article_tags` AS `at`
JOIN `tags` AS `t` ON `t`.`id` = `at`.`id_tag`
AND `t`.`name` IN ('Тег_10', 'Тег_11', 'Тег_12')
GROUP BY `id_article`
) AS `c`
JOIN `articles` AS `a` ON `a`.`id` = `c`.`id_article`
ORDER BY `c`.`count` DESC
SET @id = 0;
UPDATE `tasks`
SET `state` = 'execute', `starttime` = NOW()
WHERE @id := `id` AND `state` = 'new'
ORDER BY `time`
LIMIT 1;
SELECT * FROM `tasks` WHERE `id` = @id;
<input type="text" name="contact[]">
. Тогда в PHP придёт массив значений $_POST['contact'][].<input type="file" name="f[]">
. В обоих случаях обработка стандартная, через массив $_FILES ipfw add 100 nat 1 all from any to any via em0
ipfw add 200 allow all from any to any
ipfw show
можно увидеть, сколько раз сработало каждое правило.