Guys, this is killing me. I started writing this code and I know there has got to be a better way of writing this.
ideas?
I want to check a field in a table and see what the value is and make it select THAT option on.
ie: If the value of the field is 14, I want option value=14 to read option selecte value=14.
Is there an easy way to do this? This is where arrays and me don't meet eye-to-eye and I kick myself for never learning them...lol
$result1 = @mysql_query("SELECT * FROM auth");
$row1 = mysql_fetch_array($result1))
echo("
<option value=20>$row[name_20]</option>
<option value=19>$row[name_19]</option>
<option value=18>$row[name_18]</option>
<option value=17>$row[name_17]</option>
<option value=16>$row[name_16]</option>
<option value=15>$row[name_15]</option>
<option value=14>$row[name_14]</option>
<option value=13>$row[name_13]</option>
<option value=12>$row[name_12]</option>
<option value=11>$row[name_11]</option>
<option value=10>$row[name_10]</option>
<option value=9>$row[name_9]</option>
<option value=8>$row[name_8]</option>
<option value=7>$row[name_7]</option>
<option value=6>$row[name_6]</option>
<option value=5>$row[name_5]</option>
<option value=4>$row[name_4]</option>
<option value=3>$row[name_3]</option>
<option value=2>$row[name_2]</option>
<option value=1>$row[name_1]</option>
<option value=0>Everyone</option>
");
the way I WAS writing it, I did an IF for each and every option in the box and it was coming out to be a TON of code. The bad part is, that I have to use this combo box for 27 different options on this form, leaving me with around 1000 lines of code when I'm sure I could drop that WAY down...