My 's
num_rows > 0) {
// Output data of each row
while ($row = $result->fetch_assoc()) {
$id = $row["id"];
// Check if ID is already encountered
if (in_array($id, $encountered_ids)) {
// Skip if ID is already encountered
continue;
}
// Store the encountered ID
$encountered_ids[] = $id;
$image_url = $row["image_url"];
$title = $row["title"];
?>