Before anything else this is my PHP Code
<?php
$conn = mysqli_connect("localhost", "root", "", "mydb");
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}
$promo1 = "";
$promo2 = "";
$promo3 = "";
$sql = "SELECT prmo_itemDescription FROM promos";
$result = mysqli_query($conn, $sql);
$row = mysqli_fetch_array($result);
$promo1 = $row[0];
$promo2 = $row[1];
$promo3 = $row[2];
mysqli_free_result($result);
mysqli_close($conn);
?>
and this is where I want the description to be echoed
<div class="col-md-3">
<p><?php echo $promo1?></p>
<button type="button" class="btn btn-success" data-toggle="modal" data-target="#details-1">Buy Now!</button>
</div>
<div class="col-md-3">
<p><?php echo $promo2?></p>
<button type="button" class="btn btn-success" data-toggle="modal" data-target="#details-2">Buy Now!</button>
</div>
<div class="col-md-3">
<p><?php echo $promo3?></p>
<button type="button" class="btn btn-success" data-toggle="modal" data-target="#details-3">Buy Now!</button>
</div>
and this is my database in phpmyadmin My problem is I managed to display the $promo1 but the other two(promo2 and promo3) doesnt seem to display, it looks like it cannot find the other two rows. There's an error like unidentified offset. am I missing something?