Daney11 Posted April 13, 2007 Share Posted April 13, 2007 Hi guys. I have some information inside a database that i want to extract into a select form. <td width="163" height="20"> <?php $strQuery = "SELECT team_id, team_name FROM `teams` WHERE team_id > 0"; $result = mysql_query($strQuery,$db) or die(mysql_error()); while ($teamrow = mysql_fetch_array($result)) { $team_id = mysql_real_escape_string($teamrow['team_id']); $team_name = mysql_real_escape_string($teamrow['team_name']); ?> <select class="shoutbox" name="player_club" type="text" maxlength="10"> <option value="<?php echo "$team_id" ?>"><?php echo "$team_name" ?></option></select> <?php } ?> </td> This peice of code works, but extracts all the information in my database into a select box each, so i have over 100 select boxes, where i want all the names into one select box that you can select in the form and the team_id will be the value corresponding to the team name. Thanks guys Dane Link to comment https://forums.phpfreaks.com/topic/46905-solved-forms-and-php/ Share on other sites More sharing options...
Daney11 Posted April 13, 2007 Author Share Posted April 13, 2007 Sorted, just had to move the select box around lol Link to comment https://forums.phpfreaks.com/topic/46905-solved-forms-and-php/#findComment-228671 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.