excl209 Posted June 15, 2007 Share Posted June 15, 2007 I have the following code on a page... but I want it to be able display the record selected from the list box... this is what I have right now:- $query = "SELECT * FROM users"; $result = mysql_query($query) or die ("Error in query" . mysql_error()); for($i = 0; $i < mysql_num_rows($result); $i++) { $row = mysql_fetch_array( $result ); $TheList .= "<option> $row[first_name] </option> <br>"; } echo "Select First Name: "; echo "<select first_name='first_name'>"; echo $TheList; $student = first_name; echo "</select>"; echo "<br><br><br>"; echo "Your selection was : $student "; Thanks, Excl209 Quote Link to comment https://forums.phpfreaks.com/topic/55738-php-and-list-box-question/ Share on other sites More sharing options...
Dragen Posted June 15, 2007 Share Posted June 15, 2007 if you're wanting it to happen when a user selects an option without reloading the page you need to use javascript or ajax. to use php to do that you'd need to refresh the page. Quote Link to comment https://forums.phpfreaks.com/topic/55738-php-and-list-box-question/#findComment-275400 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.