You can't use that type of syntax when inserting into one field only.
Using a blatant insert into, your input value count MUST match the
number of columns in the table, like this:
insert into test values "this is a test", '0'
This type of insert is not recommended because if your database ever
changes, then all of your programmed query statements will have to
change too.
Better:
insert into test (field1), ("this is a test")
or
insert into test (field1), ("this is test1", "this is test2", "this is
test3")
or
insert into test set field1="this is a test"
jjliu wrote:
i have created the following table:
create table test (field1 varchar(100), id integer unsigned not null
auto_increment, unique (field1), primary key (id));
When i try to insert some values by using the following statement
insert into test values ("this is a test");
I was told "column count does not match value count at row 1".
I could not figure out what's wrong with the syntax. Could someone help me
out. Thanks.