Mysqli错误:列计数与第1行的值计数不匹配 [英] Mysqli Error: Column count doesn't match value count at row 1

查看:106
本文介绍了Mysqli错误:列计数与第1行的值计数不匹配的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

下面是正在执行的mysqli查询,任何人都知道我得到了这样的错误:

Below is the mysqli query that is being performed, anyone know what I get such error:

$sql = mysqli_query($db, "INSERT INTO `tbl_bugzilla` 
    (`id`, `by`, `title`, `content`, `date`, `application`,`priority`, `assigned`, `status`) 
    VALUES (NULL, '".$_SESSION['exp_user']['username']."', '"
        .$_SESSION['exp_user']['username']."', '".$title."', '".$content."','"
        .$dt."', '".$_POST['app']."', '".$_POST['priority']."', 'Unassigned', 'Unconfirmed')");

错误: 列数与第1行的值计数不符

更重要的是,您能解释一下错误,这样我就不会再犯同样的错误了吗?

More importantly, could you explain the error so I don't make the same mistake again?

谢谢

推荐答案

该死的东西:

我在查询中两次提到'".$_SESSION['exp_user']['username']."',,导致10列,而不是9列.

I mentioned '".$_SESSION['exp_user']['username']."', twice in the query, leading to 10 columns, not 9.

对不起,人们:(

这篇关于Mysqli错误:列计数与第1行的值计数不匹配的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆