You are not logged in.

#1 2008-01-21 6:12 pm

MonsterDK
Member
Registered: 2008-01-21
Posts: 2

phpBB2 2.0.17

Hi,

I am running an older version of phpBB2 which is 2.0.17. I can't upgrade easily due to heavy changes to the way I need it to work.

To my Question:
I have tried to import the SQL file but I got errors. I tried to execute smaller queries to isolate the issue.

If I do:
INSERT INTO `phpbb_banlist` VALUES ('', '', '', '*@lifeforlove.info');
INSERT INTO `phpbb_banlist` VALUES ('', '', '', '*@yachting-swap.com');
INSERT INTO `phpbb_banlist` VALUES ('', '', '', '*@morseliesa.com');
INSERT INTO `phpbb_banlist` VALUES ('', '', '', '*@gododlzgjzaz.com')

I get...

SQL query:

INSERT INTO `phpbb_banlist`
VALUES (
'', '', '', '*@lifeforlove.info'
);

MySQL said: Documentation
#1136 - Column count doesn't match value count at row 1



I can probably amend the file using a search and replace utility should I know how to make this compatible with phpBB2 V 2.0.17

Any help on this please?

Offline

#2 2008-01-21 7:58 pm

yannick
Member
From: Netherlands
Registered: 2008-01-12
Posts: 15

Re: phpBB2 2.0.17

the problem is there are fields added (or deleted) with the new version. With your insert statment you give only 4 values, MySQL looks up the table and tries to insert the row according to the fields and the values you gave in the statment. It finds that you missing values and give the error.

What you could do is check the table and see what values have changed and add them to your statment. Basicly the first value in the stament will go in the first field, second value in the second field, etc. You need to match the number of values with the number of fields in the table.

Offline

#3 2008-01-21 11:26 pm

MonsterDK
Member
Registered: 2008-01-21
Posts: 2

Re: phpBB2 2.0.17

Hi,

I'm not to good with SQL and would really appreciate some advice.

If I was to screen shot the layout and provide a link would you please help me ?

Offline

#4 2008-01-22 3:43 am

fspamlist
Member
Registered: 2008-01-06
Posts: 33

Re: phpBB2 2.0.17

Do all mysql versions support specifying the field names like

INSERT INTO phpbb_bans (field1,field2) VALUES ('$data1','$data2')

I think that would clear up the problem.. but I don't know if all mysql versions support this.

Offline

#5 2008-01-22 4:41 pm

yannick
Member
From: Netherlands
Registered: 2008-01-12
Posts: 15

Re: phpBB2 2.0.17

well MySQL supports that

http://dev.mysql.com/doc/refman/5.0/en/insert.html

that's the referance manual, could be handy smile

Edit:
Oh, but note that missing fields will be give the default value, if that is not set MySQL tries to set it to null. If the field maynot cantain a null value it give an error.

Last edited by yannick (2008-01-22 4:42 pm)

Offline

#6 2008-01-23 4:14 am

pavemen
Member
Registered: 2008-01-17
Posts: 17

Re: phpBB2 2.0.17

export/dump the table you have now, then use that as a template to build your new queries.

Offline

Board footer

Powered by FluxBB

Close
Close