续:点击添加一个条目就会跳转到add.php
★ //add.php
向数据库添加一个条目
/title>
;
添加条目
$database = "sunsite";
$tablename = $_GET['tablename'];
MySQL_connect ("localhost","root","") or die ("连接到数据库的问题");
$query = "显示 $tablename 中的列";
$result = mysql_db_query($database,$query );
$column = 0;
if ($result)
{
while ($r = mysql_fetch_array($result))
{
$colname[$column] = $r[0];
$column = $列 1;
}
mysql_free_result($result);
}
$id = 0;
do
{
$id ;
$query = "select * from $tablename where $colname[0]='$id'";
$result = mysql_db_query($database,$query);
}
while(mysql_fetch_array($result))
?>
">瀹