MoFish Posted April 29, 2007 Share Posted April 29, 2007 Hello. i'm trying to set the last selected username to a variable called $lastplayer. the problem im having is. the number of "$NumPlayers" changes depending on what the user selected from the page before. This can range from 4-10. How can i find which user was last selected from the last listbox? MoFish mysql_select_db($database_ReportConnection, $ReportConnection); $query_Connection = "SELECT * FROM player_table"; $Connection = mysql_query($query_Connection, $ReportConnection) or die(mysql_error()); while ($myrow = mysql_fetch_array($Connection)) { $opt .= '<option value="'.$myrow['PlayerName'].'">'.$myrow['PlayerName'].'</option>'; } for($i=1;$i<=$NumPlayers;++$i){ echo '<div style="padding:5px">'; echo 'Player : <select name="LstBox'.$i.'">'.$opt.'</select>'; echo '</div>'; } also, why does the following code not work? <?php echo "<img src='images/' . $image . ' />"; ?> Link to comment https://forums.phpfreaks.com/topic/49165-finding-value-of-last-listbox-selected/ Share on other sites More sharing options...
papaface Posted April 29, 2007 Share Posted April 29, 2007 This should be: <?php echo '<img src="images/' . $image . '"/>'; ?> Link to comment https://forums.phpfreaks.com/topic/49165-finding-value-of-last-listbox-selected/#findComment-240944 Share on other sites More sharing options...
MoFish Posted April 29, 2007 Author Share Posted April 29, 2007 thanks, any ideas about the 1st bit? Link to comment https://forums.phpfreaks.com/topic/49165-finding-value-of-last-listbox-selected/#findComment-240948 Share on other sites More sharing options...
MoFish Posted April 29, 2007 Author Share Posted April 29, 2007 anyone got any ideas? been trying to figure this out for most of the day and can't get anywhere with it Link to comment https://forums.phpfreaks.com/topic/49165-finding-value-of-last-listbox-selected/#findComment-241238 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.