SELECT
`user`.`name` AS 'USER_NAME',
`order_processing`.`idOrder` AS 'ID_ORDER',
`product`.`name` AS 'PRODUCT_NAME',
`order_position`.`amount` AS 'PRODUCT_AMOUNT'
FROM `order_position`
LEFT JOIN `product` ON `product`.`idProduct`=`order_position`.`idProduct`
LEFT JOIN `order_processing` ON `order_processing`.`idOrder`=`order_position`.`idOrder`
LEFT JOIN `user` ON `user`.`idUser`=`order_processing`.`idUser`
WHERE `user`.`idUser`=4 AND `order_processing`.`idOrder`=2;
$arr = ['05:20', '06:10', '06:55', '08:00', '09:45', '11:15', '11:50', '13:00', '13:55', '14:55', '16:10', '17:00', '17:50', '18:30', '20:10'];
$next_time = '';
foreach ($arr as $time) {
if(strtotime($time) > time()) {
$next_time = $time;
break;
}
}
echo $next_time;