Why This Happens:
$res is a mysqli_result object, not an array.
You can’t use foreach directly on a mysqli_result object. That’s why $row ends up being null.
How to Fix It:
He needs to convert the result into something iterable, like an array. Option 1: Use while and fetch_assoc() (most common way)
<?php
while ($row = $res->fetch_assoc()) {?>
<div class="card Align-Content-On-X-Axis_center">
<img src="./Images/images.jpeg" alt="ERR" />
<h3><?= $row["Name"]; ?></h3>
</div>
<?php}?>
Option 2: Convert $res to an array first, then use foreach
<?php
$rows = [];
while ($row = $res->fetch_assoc()) {
$rows[] = $row;
}
?>
<?php foreach ($rows as $row) { ?>
<div class="card Align-Content-On-X-Axis_center">
<img src="./Images/images.jpeg" alt="ERR" />
<h3><?= $row["Name"]; ?></h3>
</div>
<?php } ?>