0
当我点击提交按钮时,除了将字符串的名称放在数组中之外,所有的工作都可以使用,我在每行的列名下面的行中获得名称“数组”。我一直在改变代码,并且无法弄清楚。注意我的数组里面有130多个字符串。数据库:插入行多查询
您可以在表中放入无限量的行,对吧? 关于如何解决名称问题并增加“限制0,30”的建议?
这里是我的代码:
是:
$array = ("","","");
$random = $array;
shuffle($random);
现在:
$array = ("","","");
而且仍然无法正常工作。我也试过用mysqli_stmt_send_long_data试验也无法使它工作。
<?php
include ('login-home.php');
$mysqli = new mysqli("", "", "", "");
if ($mysqli->connect_error) {
echo "Failed to connect to MySQL: (" . $mysqli->connect_error . ") " . $mysqli->connect_error;
}
if (!$mysqli->query("INSERT INTO table(id, name) VALUES (id, '".$array."')")) {
echo "Multi-INSERT failed: (" . $mysqli->error . ") " . $mysqli->error;
}
/* Prepared statement, stage 2: bind and execute */
$id = 1;
if (!$stmt->bind_param("s", $id)) {
echo "Binding parameters failed: (" . $stmt->error . ") " . $stmt->error;
}
if (!$stmt->execute()) {
echo "Execute failed: (" . $stmt->error . ") " . $stmt->error;
}
for ($id; $id = $id+1; $id++) {
if (!$stmt->execute()) {
echo "Execute failed: (" . $stmt->error . ") " . $stmt->error;
}
}
$stmt->close();
?>
感谢带病上班的,它会需要一段时间,但试图在一个和它的工作谢谢 – vince