- if ($query = $db->query(statement: "SELECT * FROM products")) {
+ if ($query = $db->query(query: "SELECT * FROM products")) {
- $info = $query->fetchAll(fetch_style:PDO::FETCH_ASSOC);
+ $info = $query->fetchAll(mode: PDO::FETCH_ASSOC);
Не надо придумывать названия параметров из головы. Надо брать их из документации. $count = count($wareh_id);
$val = ceil($amount / $count);
$n = $amount % $count;
if ($n === 0) {
$n = $count;
}
for ($i = 0; $i < $n; $i += 1) {
$wareh_id[$i] = $val;
}
$val -= 1;
for (;$i < $count; $i += 1) {
$wareh_id[$i] = $val;
}