I have a dropdown that is loaded with dates(date_entered) pulled from a database. My table has the columns Size, Item, Description, Unit, Price, Usage, and Item Number.
My database has the same but also a date_entered. When the user selects a date from the dropdown, I need to fill the table with the corresponding data (size, item, etc.). However I'm not sure how to go about that since I think php only loads data when the page is requested. Below is the code for my dropdown. Would I add a display button for the user to click? Any help would be appreciated. Thank you
<label for="">Select invoice</label>
<div class="input-group">
<select name="invoice" id="invoice" class="form-control" type="text" list="id" placeholder="Select Number"value="<?php $Date_entered ?>">
<span class="input-group-btn">
<datalist name="id" id="id"> <span class="caret"></span>
<?php
include("Connect.php");
$result=mysql_query("SELECT Date_entered FROM orders");
while ($row = mysql_fetch_array($result)) {
unset($id);
$id = $row['Date_entered'];
echo '<option value="'.$id.'">'.$id.'</option>';
}
?>
</datalist>
</span>
</select>
</div>