MySQL列计数与第1行的值计数不匹配 [英] MySQL column count doesn't match value count at row 1

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

问题描述

我正在尝试使用PHP将数据插入MySQL表中,但出现错误

I'm trying to insert data into a MySQL table using PHP, but getting the error

列数与第1行的值数不符

Column count doesn't match value count at row 1

mysql_query("INSERT INTO file (id, filename, extention, filelink, filesize, filepass) VALUES('{$random}', '{$filename}', '{$extension}', '{$filelink}', '{$filesize}' '{$filepass}') ") or die(mysql_error());

推荐答案

mysql_query("INSERT INTO file (id, filename, extention, filelink, filesize, filepass) VALUES('{$random}', '{$filename}', '{$extension}', '{$filelink}', '{$filesize}' '{$filepass}') ") or die(mysql_error());

您应该在{$ filesize}之后添加缺少的逗号:

You should add the missing comma after {$filesize}:

mysql_query("INSERT INTO file (id, filename, extention, filelink, filesize, filepass) VALUES('{$random}', '{$filename}', '{$extension}', '{$filelink}', '{$filesize}', '{$filepass}') ") or die(mysql_error());

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

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