Re: Column count doesn't match value count at row 1?
| From: | Matt | Date: | Fri, 07 Feb 2003 18:38:04 +0000 |
| Subject: | Re: Column count doesn't match value count at row 1? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-134772@lists.php.net to get a copy of this message | ||
----- Original Message -----
From: "Jeremy Bowen" <ocarules@webnationinc.com>
To: <php-general@lists.php.net>
Sent: Friday, February 07, 2003 1:30 PM
Subject: [PHP] Column count doesn't match value count at row 1?
That means the the number of columns in the fields clause doesn't match the
number in the values. For example:
INSERT INTO table (column1,column2) values('hello','cruel','world');
[that' two columns, and three values, right]
If you're not listing columns, then you have to list all columns in values
or at least pass NULL.
Echo out the sql, and count the columns. I find it useful in long sql
statements to add newlines regularly, and the line number becomes more
useful (although in your case that probably won't help much since it's going
to error at the end). Post the sql if you can' figure it out