PHP beginner enquiry
Posted: Thu Dec 14, 2006 4:26 am
feyd | Please use
How would you suggest for me to populate the next drop down menu, i was think if statement, but im not sure how to do it with the html?
Any help appreciated
Mark
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hey Guys,
Im totally new to php, just started looking at it yesterday , but im trying to make a simple page, basically 4 drop down menus of which 3 is locked untill an option is choosen in one, each menu will be populated depending on the choice of the drop down menu preceding it.
eg menu 1 chooses "staff",
menu 2 is now populated with staff categories such as managers, employees.
so far ive managed to dynamically populate a drop down menu.Code: Select all
<tr>
<td><select size="1" name="DSquad">
<?php
$query2 = "SELECT DISTINCT Squad FROM Swimmers";
$squad=mysql_query($query2);
$num2=mysql_numrows($squad);
$i2=0;
while ($i2 < $num2) {
$squad2=mysql_result($squad,$i2,"Squad");
?>
<option><?php echo "$squad2"; ?></option>
<?php $i2++; }?>
</select></td>Any help appreciated
Mark
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]