I have a Book details form where we can insert the book details.
One of the field in this form is "Category_Id
". The value of this field is coming from database.
So I want to display all the category id that is stored in a table name " book_catagory ".
I have tried to write code which I have done it earlier also but here no values are displayed in the form. Please help me to find my mistake.
My code snippet is as follow:
<td>Enter Category ID: </td>
<td>
<?php
$select_query = "select Category_Id from book_catagory";
$select_query_run = mysql_query($select_query);
echo "<select name='category_id' id='category_id'>";
while ($select_query_array = mysql_fetch_array($select_query_run)) {
echo "<option value='" . htmlspecialchars($select_query_array['Category_Id']) . "' >" .
htmlspecialchars($select_query_array["Category_Id"]) . " </option>";
}
echo "</select>";
?>
</td>