如何使用下拉列表生成表格?

对于我的系统,当我从部门(下拉列表)中select部门名称和程序(下拉列表)中的程序名称时,它应该生成一个表格 – 在PHP中读取axc excel文件。 我试图只读一个Excel文件,它的工作原理。 如何在PHP和MySQL中将select与下面的文件连接起来?

我发现读取excel文件的代码如下:

读取Excel文件

<?php include 'reader.php'; $excel = new Spreadsheet_Excel_Reader(); ?> Sheet 1:<br/><br/> <table border="1"> <?php $excel->read('prog.xls'); // set the excel file name here $x=1; while($x<=$excel->sheets[0]['numRows']) { // reading row by row echo "\t<tr>\n"; $y=1; while($y<=$excel->sheets[0]['numCols']) {// reading column by column $cell = isset($excel->sheets[0]['cells'][$x][$y]) ? $excel->sheets[0]['cells'][$x][$y] : ''; echo "\t\t<td>$cell</td>\n"; // get each cells values $y++; } echo "\t</tr>\n"; $x++; } ?> </table><br/>