I trying make a combobox with php and mysql but i cant find a solution. How I can fix this code?
$conn = new mysqli($servername, $username, $password, $db);
$result = mysqli_query($conn, "SELECT * FROM exemple") or die (mysqli_error($conn));
?>
<form action="" method="post">
<h1>Combo</h1>
<select name="cbx" id="cbx">
<?php while($ri = mysql_fetch_array($result)) { ?>
<option value="<?php echo $ri['exemp'] ?>">
<?php echo $ri['exemp2'] ?>
</option>
</select>
<?php } ?>
</form>
$result?! please post all the code related to your issue.