Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/273.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php bind_param和插入MySQL数据库时出现问题_Php_Mysql_Syntax - Fatal编程技术网

Php bind_param和插入MySQL数据库时出现问题

Php bind_param和插入MySQL数据库时出现问题,php,mysql,syntax,Php,Mysql,Syntax,我无法将表单数据传递到数据库。Config.php正确,表读取和显示正确;我这辈子都没法让它发挥作用。而且,我做这件事并不是作为一种职业(显然)只是为了学习 <?php if ($_SERVER["REQUEST_METHOD"] == "POST") { if (isset($_POST['type']) && isset($_POST['client']) && isset($_POST['contact']) && isset(

我无法将表单数据传递到数据库。Config.php正确,表读取和显示正确;我这辈子都没法让它发挥作用。而且,我做这件事并不是作为一种职业(显然)只是为了学习

<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
if (isset($_POST['type']) && isset($_POST['client']) && isset($_POST['contact']) && 
   isset($_POST['name']) && isset($_POST['date']) && isset($_POST['po']) && isset($_POST['notes'])) {
$sql = "INSERT INTO list (type, client, contact, name, date, po, notes) VALUES (?,?,?,?,?,?,?)";
if ($stmt = $link->prepare($sql)) {
$stmt->bind_param("ssi", $_POST['type'], $_POST['client'], $_POST['contact'], $_POST['name'], 
   $_POST['date'], $_POST['po'], $_POST['notes']);
if ($stmt->execute()) {
header("location: index.php");
exit();
} else {
echo "ERROR! Please Try Again...";
}
$stmt->close();
}
}
$link->close();
}
?>


如果结果是语法问题;我要低头

ssi
值不够。请使用错误报告,它会告诉您问题所在。输出
错误也是无用的,不是你的问题,而是更容易读/写
isset($\u POST['type'],$\u POST['client'],$\u POST['contact'],$\u POST['name'],$\u POST['date'],$\u POST['po'],$\u POST['notes'])