I have been given a .php file and I would like to code a for loop that loops through database entries and populates a div for each entry. I am a total php noob, and every for loop I've found online doesn't seem to work with the code I have. Any help to get me started would be greatly appreciated.
My php code to connect to the database is as follows:
<?php
require 'mysqliconnection.php';
require 'top_bottom_functions.php';
$id = $_GET['id'];
$stmt_get_details = mysqli_prepare($connect, "SELECT name, nickname, birth_day, birth_place, age, division, fighter_record, stance, height, reach, directory, biography, flag, record FROM fighters_details WHERE id=?");
if ($stmt_get_details) {
mysqli_stmt_bind_param($stmt_get_details, "s", $id);
mysqli_stmt_execute($stmt_get_details);
mysqli_stmt_bind_result($stmt_get_details, $name, $nickname, $birth_day, $birth_place, $age, $division, $fighter_record, $distance, $height, $reach, $directory, $biography, $flag, $record);
}
mysqli_stmt_fetch($stmt_get_details);
$height = html_entity_decode($height);
$reach = html_entity_decode($reach);
mysqli_stmt_close($stmt_get_details);
?>
Thank you!