TheConeHead
Programmer
What is wrong with this? I get to records of 'VA'... It does not move onto 'WV'
<?
$state_array = array("VA","WV"
;
$stArrPlace = 0;
while ($strArrPlace < 2) {
$result = mysql_query("SELECT * FROM counties where state = '$state_array[$stArrPlace]'"
;
$num_rows = mysql_num_rows($result)+1;
$count=1;
print "case '$state_array[$stArrPlace]':\n";
print "document.forma.countyI.options.length = $num_rows;\n";
print "document.forma.countyI.options[0] = new Option('Mine Is Not Listed', 'None');\n";
while ($a_row = mysql_fetch_array($result)) {
print "document.forma.countyI.options[$count] = new Option('$a_row[name]', '$a_row[id]');\n";
$count++;
}
$strArrPlace++;
}
print "break;\n\n";
?>
![[conehead] [conehead] [conehead]](/data/assets/smilies/conehead.gif)
<?
$state_array = array("VA","WV"

$stArrPlace = 0;
while ($strArrPlace < 2) {
$result = mysql_query("SELECT * FROM counties where state = '$state_array[$stArrPlace]'"

$num_rows = mysql_num_rows($result)+1;
$count=1;
print "case '$state_array[$stArrPlace]':\n";
print "document.forma.countyI.options.length = $num_rows;\n";
print "document.forma.countyI.options[0] = new Option('Mine Is Not Listed', 'None');\n";
while ($a_row = mysql_fetch_array($result)) {
print "document.forma.countyI.options[$count] = new Option('$a_row[name]', '$a_row[id]');\n";
$count++;
}
$strArrPlace++;
}
print "break;\n\n";
?>
![[conehead] [conehead] [conehead]](/data/assets/smilies/conehead.gif)