0
我創建一個表格,其中包括兩個文本框&一個提交按鈕,當我輸入行數&列,並點擊提交&列的表結構將在形式生成的行數按鈕,當我將數據輸入到該表中時,我想將該數據保存到數據庫中。請,如果您有任何演示的例子,那麼請給它緊迫,我在此先感謝..保存運行時創建的表中的數據到數據庫
這是我的PHP代碼:
<?php
include_once "dreportCreation.php";
{
if(isset($_POST['submit']))
function displaydata($column,$rows)
{
echo "<table border='1' align='center'>";
for($i = 0;$i<$_POST['column'];$i++)
{
echo "<tr>".$j."</tr>";
for($j = 0; $j <$_POST['rows'];$j++)
{
echo "<td>" ."<input type=\"text\" name='$i'>"."</td>";
}
}
echo "</table>";
}
}
?>
<html>
<head>
<title>aa</title>
</head>
<body>
<form name="reportCreation" method="post" action="dd.php">
<label for='Table'>Define Table</label>
<label for='rows'>Row</label>
<input type="text" name="column"></input>
<label for='column'>Column</label>
<input type="text" name="rows"></input>
<input type="submit" name="submit" value="submit" onclick="displaydata();">
</form>
</body>
</html>