Drop down selection from two columns

Hi all. I have a table called students. In it two columns are Firstname and Surname.

I have a dropdown selection which I want to pull from both those columns and then when the form is submitted they get written to another table also with Firstname and Surname. I have managed the first part but am stuck on the second part when the separate colums get posted back to the database.

[php]

<?php $options = ''; $filter=mysql_query("select * from students"); while($row = mysql_fetch_array($filter)) { $options .="" . $row['firstname'] . " " .$row['surname'] . ""; } $menu=" Student Name " . $options . " "; echo $menu; ?>[/php]

As I say the first part when it pulls the firstname and surname works but the second part is a little beyond me at this point.

Thanks all for looking at this.

Paul

You are using obsolete, insecure code that has been completely removed from Php. You need to use PDO. https://phpdelusions.net/pdo

Sponsor our Newsletter | Privacy Policy | Terms of Service