query mysql from php drop down list
| From: | Pete Kuczynski | Date: | Fri, 29 Jun 2001 20:16:25 +0000 |
| Subject: | query mysql from php drop down list | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-8110@lists.php.net to get a copy of this message | ||
Hi,
I use a html frop down list to choose an item to be placed into a cell.
This causes much work when updating the site as the html code needs
updating:
Device: </td>
<td width="25%"><select size="1" name="device"
tabindex="3">
<option selected>some device</option>
<option>AOC Spectrum 4V CRT</option>
<option>Arlan 630 antenna</option>
<option>AT&T CRT</option>
<option>AT&T CRT 0131</option>
<option>AT&T CRT 314</option>
<option>AT&T CRT 324</option>
<option>AT&T CRT 329D</option>
<option>AT&T CRT 334</option>
<option>AT&T CRT 7134</option>
I would like to have my php script instead query a table in my database
for this information.
Here is the partial update query script in use:
while($row = mysql_fetch_object($result1)) {
echo "<td align=right>Site ID: <input type=text name='site_id'
value='$row->site_id'></td><tr>";
echo "<td align=right>Hostname: <input type=text name='hostname'
value='$row->hostname'></td><tr>";
echo "<td align=right>Device: <input type=text name='device'
value='$row->device'></td><tr>";
My question is, how can I change the last field above, the device field,
if I wan't it to work as a lookup table and replace the html table
aboce. So it will work like a list box, and allow you to choose from 30
diferent items.
Thanks for any insight.
Pete