Re: Column count doesn't match value count at row 1?
| From: | Chris Shiflett | Date: | Fri, 07 Feb 2003 19:04:36 +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-134774@lists.php.net to get a copy of this message | ||
--- Jeremy Bowen <ocarules@webnationinc.com> wrote:
> I am modifying some else's script I added some rows to
> the myself database and no I get this error when I try
> to add information to the database.
Most likely, the SQL statement in question is something
like this:
insert into foo values ('bar', 'php', 'stuff');
In this example, table foo has three columns. Because the
insert statement doesn't specify the columns, it is assumed
that a value is being given for each.
If you alter the database to add a column to foo, this
statement will fail, because there are four columns and
three values.
You can:
1. Change the SQL statement to specify the columns that
were being used before (basically all of them except the
ones you added)
or
2. Change the SQL statement to include a value for each
column you added.
Chris