$goods = mysqli_query($connection, "SELECT * FROM `goods` $orderBy LIMIT 6");
foreach ($goods as $item) {
...
}
$goods = mysqli_query($connection, "SELECT * FROM `goods` $orderBy LIMIT 6");
while ($item = mysqli_fetch_assoc($goods)) {
...
}
while ($item = mysqli_fetch_assoc($goods)) {
foreach ($goods as $item) {