gpt4 book ai didi

PHP、MySQL 错误 : Column count doesn't match value count at row 1

转载 作者:IT老高 更新时间:2023-10-28 12:57:09 27 4
gpt4 key购买 nike

我收到此错误:

列数与第 1 行的值数不匹配

来自以下代码:

$name = $_GET['name'];
$description = $_GET['description'];
$shortDescription = $_GET['shortDescription'];
$ingredients = $_GET['ingredients'];
$method = $_GET['method'];
//$image = $_GET['image'];
$username = $_GET['username'];
$length = $_GET['length'];
$dateAdded = uk_date();
$conn = mysql_connect('localhost', 'dbname', 'pass');
mysql_select_db('dbname');
$query = sprintf("INSERT INTO dbname (id, Name, Description, shortDescription, Ingredients, Method, Length, dateAdded, Username) VALUES ('', '%s', '%s', '%s', '%s', '%s', '%s', '%s')",
mysql_real_escape_string($name),
mysql_real_escape_string($description),
mysql_real_escape_string($shortDescription),
mysql_real_escape_string($ingredients),
//mysql_real_escape_string($image),
mysql_real_escape_string($length),
mysql_real_escape_string($dateAdded),
mysql_real_escape_string($username));

$result = mysql_query($query) or die(mysql_error());

错误是什么意思?

最佳答案

您列出了 9 个字段,但只有 8 个值。尝试添加方法。

关于PHP、MySQL 错误 : Column count doesn't match value count at row 1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5931900/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com