在Datalist问题中显示来自MySQL的数据

I have a <datalist> element that gets a list of names from a table in a MySQL database. The list suggests names when you start typing, however there are some double Barrelled names in the Database, which it does not list.

Here is the code, showing the while loop etc.

<?php
$sql="SELECT * FROM students";
$result=mysql_query($sql);
    echo '<input id="ChildName" name="ChildName" list="names" style=" width:450px; height:45px;font-size:20pt;" maxlength="15" size="6" > <datalist id="names">';
    while($rows=mysql_fetch_array($result)){
    ?>
    <option value="<?php echo $rows[Name]; ?>">
    <?php
    }
    ?>
    </datalist>

I am a Network / System Administrator but I have write code while selecting my own available Database, Please change columns accordingly, here is the solution and hope this will work for you as well

<?php
$dbHost = 'localhost';
$dbUser = 'root';
$dbPass = '';
$dbName = 'rizwanranjha';

$dbConn = mysqli_connect ($dbHost, $dbUser, $dbPass) or die ('mysqli connect failed. ' . mysqli_error());
mysqli_select_db($dbConn, $dbName) or die('Cannot select database. ' . mysqli_error());

$sql = mysqli_query($dbConn, "SELECT * FROM iph_country");

echo '<input id="ChildName" name="ChildName" list="names" style=" width:450px; height:45px;font-size:20pt;" maxlength="15" size="6" >';
echo '<datalist id="names">';
    while ($row = mysqli_fetch_array($sql)) {
    echo "<option value='". $row['country_id']. "'>" . $row['country_name'] ."</option>";
    }
echo '</datalist>';

?>
<?php
$sql="SELECT * FROM students"; 
$result=mysql_query($sql);
echo '<input id="ChildName" name="ChildName" list="names" style=" width:450px; height:45px;font-size:20pt;" maxlength="15" size="6" > <datalist    id="names">';
while($rows=mysql_fetch_assoc($result)){
?>
<option value="<?php echo $rows["Name"]; ?>">
<?php
}
?>
</datalist>

either you use mysql_fetch_assoc($result) and then use $row['columnname'] OR you use mysql_fetch_array($result) and then use $row[1];