So instead of caption1, caption2, caption3 etc, how am I able to just pull the caption from a DB? Probably simple but I'm fairly new so I apologize.
<?php
    $captions = array(
    /*01*/ "caption1",
    /*02*/ "caption2",
    /*03*/ "caption3",
    /*04*/ "caption4",
    ); 
    for($n = 1; $n <= count($captions); $n++):
?>
EDIT: And yes I have a DB connected.
Here is my attempt at trying to retrieve the captions. Unfinished yet because I'm not to sure if I'm even going in the right direction.
<?php
            $query = mysql_query("SELECT * FROM images_tbl");
            $array = array();
            while($row = mysqli_fetch_assoc($array)){
            echo $row['caption'];
                        }
                $caption = array ( "");
                for($n = 1; $n <= count($caption); $n++):
            ?>
 
     
    