PDA

Click to See Complete Forum and Search --> : help


scsa20
Jan 20th, 2002, 02:26 AM
yeah, does anyone knows that the following means??


Database error in WoltLab Burning Board: Invalid SQL: INSERT INTO bb1_boards VALUES ('','0','test','','test','0','0','0','0','1','0','0','')
mysql error: Column count doesn't match value count at row 1
mysql error number: 1136
Date: 19.01.2002 @ 01:50
Script: /admin/admin.php
Referer: http://sforums.coolfreepages.com/admin/a...fd8da77ea3abcc9

There seems to be some technical problems with the database at this moment.
Please use the reload-button of your browser to try again.
If these problems continue, please contact the Admin of this Forum.


how do I fix this, I only get it when trying to make a forum for my board :(

riis
Jan 20th, 2002, 10:21 AM
I think your SQL syntax is wrong. You forgot to use column names.
Since you used 13 values, you should also insert 13 column names.
Syntax = INSERT INTO bb1_boards (col_name1, col_name2, ..., col_name13) VALUES (your comma-separated list of values).

scsa20
Jan 20th, 2002, 11:07 AM
I had it like that (('','0','test','','test','0','0','0','0','1','0','0','')) before with no errors but now it does :(

Cudabean
Jan 21st, 2002, 10:34 AM
It's dangerous to say:

INSERT INTO bb1_boards VALUES ('','0','test','','test','0','0','0','0','1','0','0','')

Because sometimes it works and sometimes it doesn't work. It might work today, but if you add or remove a column from the database, it will stop working. If you use the more complete syntax, your inserts wont break suddenly when you change the database.

The preferred syntax is:
INSERT INTO bb1_boards field1, field2, field3...field13 VALUES
('','0','test','','test','0','0','0','0','1','0','0','')

cudabean

Cudabean
Jan 21st, 2002, 10:36 AM
Oops, I think I forgot some required parenthesis:
INSERT INTO bb1_boards (field1, field2, field3...field13) VALUES
('','0','test','','test','0','0','0','0','1','0','0','')

cudabean