When I am trying the code below, I get a blank dropdown. Is there anything wrong with this piece of code?
<?php
include ("Connect.php");
$db = new mysqli('localhost', $dbuser, $dbpass, $dbname);
?>
<div class="label">Select Customer Name:</div>
<select name="CustomerName">
<option value = "">---Select---</option>
<?php
$stmt = $db->prepare("SELECT `CustomerName` FROM `tafileuploadmappinghistory`");
$stmt->execute();
$stmt->bind_result($name);
while ($stmt->fetch()){
echo "<option value='$name'></option>";
}
$stmt->close();
?>
</select>