2-мя Хэннеси ваш брат переоценил
а что лучше с точки зрения бизнеса, продвижения ну и т.д.
$sql = 'SELECT al.order_id, MIN(al.x) as x1, MIN(al.y) as y1, MAX(al.x)+1 as x2, MAX(al.y)+1 as y2, (MAX(al.x)+1-MIN(al.x))*(MAX(al.y)+1-MIN(al.y)) as sumpix, mi.text as text, mi.link as link, mi.img_id as img_id, mi.img_type as img_type, mi.name as name, mi.email as email, mi.phone as phone, inet_ntoa(mi.user_ip) as user_ip, mi.mill_date as mill_date, mi.mill_id as mill_id, (SELECT COUNT(*) FROM mill_like WHERE mill_like.like_order_id = mi.mill_id) AS like_count, (SELECT COUNT(*) FROM mill_like WHERE mill_like.like_order_id = mi.mill_id AND mill_like.like_ip=INET_ATON("'.$ip.'")) AS like_ip FROM all_items al, mill_items mi WHERE order_id>0 AND s=2 AND al.order_id=mi.mill_id AND mi.text LIKE ? group by order_id ORDER BY order_id ASC LIMIT '.$start.', '.$num;