Hello
I want an array to appear in a form as a drop down menu.
I am struggling with the foreach code.
So far I have got
<TD WIDTH="50%" HEIGHT="32"><FONT FACE="Arial, Helvetica, sans-serif">Client:</FONT></TD>
<TD WIDTH="50%"><FONT FACE="Arial, Helvetica, sans-serif">
<?php
echo '<select name="client">
<option selected>choose</option> '
foreach($CoName as $value){
printf("<option>".$value."</option>");
}
echo '</select>'?>
</FONT></TD><TR>
but this doesn't work - Parse error: parse error, expecting ','' or
';'' in the line foreach($CoName as $value)
By the way, the variable $CoName comes from a query earlier in the code that I have echo'd out to test and it does work......
Firstly is the use of foreach correct in this type of code request?
Secondly what should the correct syntax be, I have looked in the manual and cannot see any difference to what I have in my code.
thanks