I have to select forms, one for states and countries, my countries form works but my states one does not. I am kinda confused why the states select FORM will not populate from MySql.
<tr>
<td class="label">State:</td>
<td class="field">
<select name="state">
<?php if (isset($_POST['state'])) { ?>
<option selected value="<?php echo $_POST['state'] ?>"><?php echo $_POST['state'] ?>
<?php } ?>
<option value="">
<?php
$result = mysql_query("SELECT abbrv, states FROM wsd_states ORDER BY states");
if ($result) {
if ($frow = mysql_fetch_row($result)) {
do {
echo '<option value="' . $frow[0] . '">' . $frow[1];
} while ($frow = mysql_fetch_row($result));
}
}
?>
</select></td>
</tr>
<tr>
<td class="label">Country:</td>
<td class="field">
<select name="country">
<?php if (isset($_POST['country'])) { ?>
<option selected value="<?php echo $_POST['country'] ?>"><?php echo $_POST['country'] ?>
<?php } ?>
<option value="">
<?php
$result = mysql_query("SELECT country, country_name FROM wsd_countries ORDER BY country_name");
if ($result) {
if ($frow = mysql_fetch_row($result)) {
do {
echo '<option value="' . $frow[0] . '">' . $frow[1];
} while ($frow = mysql_fetch_row($result));
}
}
?>
</select> </td>
</tr>
This page is a part of my current project, if you need you can go to okauchee.fearfx.com/login.php - login using user: tester | pass: test
then click profile on the top navigation.
Thats the page where I display the to select forms.