如何将此数组插入我的数据库?假设我已经有一个数据库?
<?php
if(isset($_POST['myname'], $_POST['myage'], $_POST['mygen']) === true){
//这是我设置键和值的代码
$array = array($_POST['myname'], $_POST['myage'], $_POST['mygen']);
foreach ($array as $i => $values) {
print "<pre>$i {\n";
foreach ($values as $key => $value) {
print " $key => $value\n";
}
print "}\n</pre>";
}
}
?>
<html>
<head>
<script type="text/javascript" >
function CreateTextbox()
//我通过这段代码动态生成文本框
{
createTextbox.innerHTML = createTextbox.innerHTML +"Name: <input type='text' name='myname[]' /><br>"
+"Age: <input type='text' name='myage[]' /><br>"
+"Gender: <input type='text' name='mygen[]' /><br>"
}
</script>
</head>
<body>
<form action="" method="post">
<div id="createTextbox"></div>
<input type="button" value="clickHere" onClick="CreateTextbox()" />
<input type="submit" value="Submit" name="submit" />
</form>
</body>
</html>
请帮忙 :(