<?php
function exceptionHandler($e)
{
var_dump($e);
}
function shutdown()
{
echo 'Скрипт успешно завершился', PHP_EOL;
}
register_shutdown_function('shutdown');
set_exception_handler('exceptionHandler');
test();
/*
object(Error)#1 (7) { ["message":protected] => string(33) "Call to undefined function test()", ... }
Скрипт успешно завершился
*/
SELECT *
FROM products p
WHERE p.active='1'
ORDER BY p.id DESC
LIMIT 0,25
SELECT op.order_id,
COUNT(op.id) AS ordersCount,
SUM(op.count) AS countOrdersCount,
SUM(op.price * op.count) AS ordersSum
FROM orders_products op
LEFT Join orders o
ON op.order_id = o.id
WHERE
op.order_id IN (/* всего лишь 25 значений из предыдущего запроса */) AND
op.item_id = p.id AND
o.date > "2020-01-01" AND
o.status != 2
SELECT * FROM `rsi` WHERE `tf`='4h' UNION
SELECT * FROM `rsi` WHERE `tf`='15m' UNION
SELECT * FROM `rsi` WHERE `tf`='4h' UNION
SELECT * FROM `rsi` WHERE `situation`='perek' AND `tf`='1d' UNION
SELECT * FROM `rsi` UNION
SELECT * FROM `levels` WHERE `situation`='support' AND `tf`='4h' UNION
SELECT * FROM `levels` WHERE `tf`='1h'
ORDER BY `time` DESC LIMIT 0,20
select A.point_id, A.schedule_calendar_id, A.date, count(*) cnt
from (
select distinct s.user_id, s.point_id, s.schedule_calendar_id, sc.date
from schedule s
join schedule_calendar sc on s.schedule_calendar_id = sc.id
) A
group by A.point_id, A.schedule_calendar_id, A.date
having count(*) > 1