I want to add values in option tag from sql database with the help of php. I have tried it but it is not showing anything
Here is my code which I have tried
<form action="addsubcategory.php" method="post">
<input type="text" name="sub_category" placeholder="Add sub category">
<?php
$res = mysqli_query($conn, "SELECT * FROM product_category");
echo '<select name="testSelect" id="testId">';
//Here is the problem
while ($record = mysqli_fetch_array($res)) {
echo '<option value="'.$record['category_name'].'">' . "</option";
}
echo '</select>';
?>
</form>