我想用一个下拉列表来选择php中的不同表,怎么做? [关闭]

databases:school

table :student
table :teacher

select name="booktype"

$selectOption = $_GET['booktype'];

can I use? ==> select * from **$selectOption** where class = 3A

yes you can:

$selectOption = pg_escape_string($_GET['booktype']);

use "select * from {$selectOption} where class = 3A"
or  "select * from ".$selectOption." where class = 3A"