> i've looked around the web a bit more & it would appear you can't just
> a
> foreach function, apparently you need to use a while{foreach{}}
> i
> was hoping you could just use the foreach function?
> so this is the code now:
> <select name="deptsub_select">
>   <option>-select-</option>
>     <?PHP
>     while ($row = mysql_fetch_array($result_deptsub)){
>       foreach ($row as $value) {
>         echo "<option value=\"$value\">$value</option>\n";

Where did you get the idea to use foreach? Your select statement is only
selecting one column, so $row is only going to have one column in it for
each mysql_fetch_*. 

Use something like this:

while($row = mysql_fetch_array($result_deptsub))
{ echo "<option
value=\"{$row['deptsub']}\">{$row['deptsub']}</option>\n"; }

---John Holmes...

PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to