You’ll need much more than just a foreach loop. First you have to get the data from the spreadsheet (.xls) into your database. You can do that by first exporting a csv file of your spreadsheet data. Then you can use something like mysql’s load data infile to load the csv data into a database table. Or write your own ascii loader. Once you have the data in a table you can use php to run an sql select statement to extract the table data. Then use a WHILE loop to loop through the sql query’s result set to create your drop down.