I have the following php code
<select class="form-control" name="txtNakshatra">
<?php
$query = "SELECT * FROM MasterTable;
$result = mysqli_query($dbcon, $query);
while ($row = mysqli_fetch_array($result)) {
echo "<option value='" . $row['Id'] . "'>" . $row['Name'] . "</option>";
}
?>
</select>
Which will Display all the details from the master table in a combo box.
Now I am inserting $row['Id']
into client
Table. So In client
table I have stored the particular row value.
Now when I open the same page, I need to display the stored value in the Combo box.
If I select master_table_value_1
from the listbox
for the first time which will have the value
as 15
. the next time when I load the page, I need to display master_table_value_1
in my Combo box.
How to do it? Any help appreciated