mysqli::query
Возвращает false в случае неудачи. В случае успешного выполнения запросов SELECT, SHOW, DESCRIBE или EXPLAIN mysqli_query() вернёт объект mysqli_result.
if ($row)
приводится к true, условие выполняется, клиенту возвращается "true". $2y$10$jSAr/RwmjhwioDlJErOk9OQEO7huLz9O6Iuf/udyGbHPiTNuB3Iuy
2y - тип хэша, BCRYPT.$simpleDate = date('m-d');
if ($simpleDate >= '12-20' || $simpleDate <= '01-11') {
...
}
class Config
{
public const LOGOS = [
['from' => '01-01', 'to' => '01-11', 'logo' => 'logo-newyear.png'],
['from' => '04-25', 'to' => '05-03', 'logo' => 'logo-firstmay.png'],
...,
['from' => '12-20', 'to' => '12-31', 'logo' => 'logo-newyear.png']
];
}
...
$simpleDate = date('m-d');
$logoName = 'logo-standard.png';
foreach (Config::LOGOS as $logoDef) {
if ($simpleDate >= $logoDef['from'] && $simpleDate <= $logoDef['to']) {
$logoName = $logoDef['logo'];
}
}
SELECT *
FROM `products`
JOIN (
SELECT MAX(`discount_price`) AS `max_price`, `product_id`
FROM `options`
GROUP BY `product_id`
) AS `max` ON `max`.`product_id` = `products`.`id`
ORDER BY `max`.`max_price` ASC
LIMIT 24
Traditionally, and according to ECMAScript, all primitives and objects are loosely unequal to undefined and null
uasort($ar, static fn($a, $b) : int => $a[0] - $b[0]);