【发布时间】:2014-12-15 08:12:49
【问题描述】:
我正在努力为我的项目找到错误的解决方案,有人可以帮助我并告诉我正确的方法。
这是我的代码:
$productkey = $_SESSION['key'];
$productuser = $_SESSION['user'];
$productemail = $_SESSION['email'];
// Include Database Connection
require 'assets/sys/config.php';
$query = dbConnect()->prepare("INSERT INTO _system (_product_key, _product_user, _product_email, _site_email, _site_title) VALUES (:_product_key, :_product_user, :_product_email, :_site_title, :site_email)");
$query->bindParam(':_product_key', $productkey);
$query->bindParam(':_product_user', $productuser);
$query->bindParam(':_product_email', $productemail);
$query->bindParam(':_site_title', $_POST['sitetitle']);
$query->bindParam(':_site_email', $_POST['siteemail']);
$query->execute();
我收到的错误:
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY093]: Invalid parameter number: parameter was not defined' in
【问题讨论】:
-
你有没有 session_start();一开始?