Retrieving table data in the database
Posted: Fri Jul 30, 2010 1:51 pm
Good Morning all,
I have a problem in retrieving table data to a drop down menu. Here's the setup:
I have a drop down menu where the user will need to select a territory. The code for that one is
<select name="territory" width="230" style="width: 143px" id="territory">
<option selected="selected" disabled="disabled">Select Territory</option>
<option>Territory 1</option>
<option>Territory 2</option>
<option>Territory 3</option>
<option>Territory 4</option>
<option>Territory 5</option>
<option>Territory 6</option>
<option>Territory 7</option>
<option>Territory 8</option>
<option>Territory 9</option>
<option>Territory 10</option>
</select>
Adding the information in the database is working fine. My problem is the retrieval of the information to the drop down menu. In case the user would want to edit information, the data being displayed by the drop down menu is not the data stored in the database, but the "Select Territory" option. So if the user modifies the information, and updated some of the fields, but not the drop down menu, the database will be updated to "blank".
I am a newbie in the industry and is trying my best to learn codes, and not just copy the code in the Internet and paste it on the program. I hope anyone can help me with this. Any response will be appreciated. Thank you.
I have a problem in retrieving table data to a drop down menu. Here's the setup:
I have a drop down menu where the user will need to select a territory. The code for that one is
<select name="territory" width="230" style="width: 143px" id="territory">
<option selected="selected" disabled="disabled">Select Territory</option>
<option>Territory 1</option>
<option>Territory 2</option>
<option>Territory 3</option>
<option>Territory 4</option>
<option>Territory 5</option>
<option>Territory 6</option>
<option>Territory 7</option>
<option>Territory 8</option>
<option>Territory 9</option>
<option>Territory 10</option>
</select>
Adding the information in the database is working fine. My problem is the retrieval of the information to the drop down menu. In case the user would want to edit information, the data being displayed by the drop down menu is not the data stored in the database, but the "Select Territory" option. So if the user modifies the information, and updated some of the fields, but not the drop down menu, the database will be updated to "blank".
I am a newbie in the industry and is trying my best to learn codes, and not just copy the code in the Internet and paste it on the program. I hope anyone can help me with this. Any response will be appreciated. Thank you.