Jump to content

php and list box question


excl209

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/55738-php-and-list-box-question/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.