sql error can't ban users???

This is an archive of the phpBB 2.0.x support forum. Support for phpBB2 has now ended.
Forum rules
Following phpBB2's EoL, this forum is now archived for reference purposes only.
Please see the following announcement for more information: viewtopic.php?f=14&t=1385785
Locked
eposner
Registered User
Posts: 61
Joined: Fri Apr 14, 2006 6:55 pm

sql error can't ban users???

Post by eposner » Thu Sep 18, 2008 2:47 pm

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:
Last edited by ric323 on Sun Sep 21, 2008 11:21 am, edited 1 time in total.
Reason: Topic icon changed
wanna learn how to make money online go to
http://eposner.webprosperity.com

espicom
Registered User
Posts: 17905
Joined: Wed Dec 22, 2004 1:14 am
Location: Woodstock, IL

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

Post by espicom » Fri Sep 19, 2008 5:35 pm

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.
Jeff
Fixing 1016/1030/1034 Errors | (obsolete link) | MySQL 4.1/5.x Client Error | phpBBv2 Logo in ACP
Support requests via PM are ignored!
"To be fully alive is to feel that everything is possible." - Eric Hoffer

eposner
Registered User
Posts: 61
Joined: Fri Apr 14, 2006 6:55 pm

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

Post by eposner » Fri Sep 19, 2008 6:08 pm

THANK YOU SOOOOO much you have saved my life....it worked perfectly
wanna learn how to make money online go to
http://eposner.webprosperity.com

Locked

Return to “2.0.x Support Forum”