当前位置:   article > 正文

mysql列与行的计数不匹配_PHP,MySQL错误:列计数与第1行的值计数不匹配

数据库插入数据时列计数和第一行的值计数

我收到这个错误:

Column count doesn't match value count at row 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());错误是什么意思?

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Gausst松鼠会/article/detail/601895
推荐阅读
相关标签
  

闽ICP备14008679号