SELECT * FROM `dle_post` WHERE CONCAT('|', `xfields`, '|') LIKE '%|key|123|%'
<?php
$from = DateTime::createFromFormat("m.Y", "1.2023");
$to = DateTimeImmutable::createFromFormat("m.Y", "12.2024");
$interval = DateInterval::createFromDateString('1 month');
while ($from < $to) {
echo $from->format('m.Y') . PHP_EOL;
$from = $from->add($interval);
}
echo $to->format('m.Y') . PHP_EOL;
<?php
$response = '{"status":"success","1":{"transaction":"8025400","email":"Не указана","amount":"21.38","currency":"RUB","currency_amount":"20.00","comission_percent":"6.90","comission_fixed":"0.00","amount_profit":"20.00","method":"Не выбран","payment_id":"1618399991","description":"Покупка доступа на 2 дня","date":"2023-03-13 19:40:46","pay_date":"2023-03-13 19:40:46","transaction_status":"0","custom_fields":"null","webhook_status":"0","webhook_amount":"0"}}';
$data = json_decode($response, true);
$transaction_status = $data["1"]["transaction_status"] ?? -1;
switch ($transaction_status) {
case -1:
echo 'Статус транзакции неизвестен';
exit(0);
case 0:
echo 'Статус транзакции = 0';
exit(0);
default:
echo 'Статус транзакции не равен 0';
}
select
req_id, req_text,
recipient.name as recipient_name,
sender.name as sender_name
from request
join users as recipient on request.recipient_id = recipient.id
join users as sender on request.sender_id = sender.id;
Create table course (
id serial primary key,
name text
);
Create table programm (
id serial primary key,
name text
);
Create table course_programms (
cource_id int references course(id),
progamm_id int references programm(id),
programm_order int,
primary key (cource_id, progamm_id)
);
CREATE TABLE User (
id INTEGER NOT NULL AUTO_INCREMENT,
login VARCHAR(255) NOT NULL,
password VARCHAR(255) NOT NULL,
status INTEGER NOT NULL,
PRIMARY KEY (id)
);
CREATE TABLE Message (
id INTEGER NOT NULL AUTO_INCREMENT,
userid INTEGER NOT NULL,
message VARCHAR(255) NOT NULL,
PRIMARY KEY (id),
FOREIGN KEY (userid) REFERENCES User(id)
);
SELECT order_number, order_status, order_date
FROM (
SELECT order_number, order_status, order_date,
RANK() OVER(PARTITION BY order_number ORDER BY order_date DESC) AS r
FROM orders
) t
WHERE r = 1
select
p.name,
group_concat(case when a.name = 'color' then pa.val end) colors
from products p
join products_attributes pa on p.id = pa.product_id
join attributes a on a.id = pa.attribute_id
group by p.id, p.name;
select d, STR_TO_DATE(d,'%d/%m/%Y в %H:%i')
from t
order by STR_TO_DATE(d,'%d/%m/%Y в %H:%i');
curl -fsSL https://deb.nodesource.com/setup_19.x | bash - &&\
apt-get install -y nodejs