这是你的问题:
$sql = mysqli_query($conn, $query); if ($conn->query($sql) === TRUE) { echo "New record created successfully"; } else { echo "Error: " . $sql . "
" . $query . "
" .$conn->error; }
你两次调用mysqli_query,第一个插入记录:
$sql = mysqli_query($conn, $query);
第二次,它只对字符串"1"运行查询,但随后您的错误报告连接错误的内容以报告问题.
怎么样
$result = mysqli_query($conn, $query); if ($result) { echo "New record created successfully"; } else { echo "Error: " . . "
" . mysqli_error($conn); }