我正在使用phpmydatagrid来显示许多表格
要确定哪个表,我正在使用GET
这是班级:http://www.phpclasses.org/browse/file/18544.html
javascript部分:http://www.phpclasses.org/browse/file/18559.html
这是我的代码的一部分:
include ("phpmydatagrid.class.php");
$objGrid = new datagrid;
$getId = $_GET['id'];
$tablename = "xxx_$getId";
//Some code here...
$objGrid -> tabla($tablename); //This is how you set the table using the class
表格显示正确,如果我回显$ objGrid-> tablename,我会得到正确的表名。
但是当您尝试使用界面添加新行时,表名突然变为“xxx_”而没有ID
我查看了类代码,并且没有地方'tablename'被更改。对于查询,只需在类中搜索“INSERT INTO”
我希望自己足够清楚,类文件也可以帮助你理解。