Dear Friend,
I create a dropdown list and want to retrieve data(company name list) from MYSQL to this dropdown list ,please, help me.no error but data does not show.
code is bellow
Company Name:
<?php
include "conn.php";
$sql="SELECT * FROM login1 ";
$result=$conn->query($sql);
echo "<select name=cn value=''>Company Name</option>"; // list box select command
foreach ($conn->query($sql) as $row){//Array or records stored in $row
echo "<option value='$row[id]'></option>";
/* Option values are added by looping through the array */
}
echo "</select>";// Closing of list box <br>
?> <br>
please help me.