Page 1 of 1

sql error can't ban users???

Posted: Thu Sep 18, 2008 2:47 pm
by eposner
i am at a bit of a loss on how to fix this one....
i have installed several phpbb forums in the past i have never had this problem.... can someone please help.


Couldn't insert ban_userid info into database

DEBUG MODE

SQL Error : 1364 Field 'ban_ip' doesn't have a default value

INSERT INTO phpbb_banlist (ban_userid) VALUES (3)

Line : 195
File : admin_user_ban.php

:oops:

Re: sql error can't ban users???

Posted: Fri Sep 19, 2008 5:35 pm
by espicom
Older versions of MySQL would quietly put a default value in when none was provided or in the database definition; newer versions (4.1 and later), along with MS SQL and others, give an error message. And this qualifies as a bug in phpBB, in my opinion, because the table itself should either have default values on every field, or the program should not make assumptions that those defaults exist.

The fix is to use phpmyadmin if you have it, and inspect the properties of phpbb_banlist. On each of the three ban fields (ban_ip, ban_userid, ban_email) you can either set them to allow NULLs, or put in a default for them that won't interfere with real users. The ban_userid field should have a zero default in it already.

Re: sql error can't ban users???

Posted: Fri Sep 19, 2008 6:08 pm
by eposner
THANK YOU SOOOOO much you have saved my life....it worked perfectly