MyBB Community Forums

Full Version: SQL Error: 1364 - Field 'newpoints_items' doesn't have a default value
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello currently getting an issue when adding a new registration on my website getting this error. 

<error>
 <dateline>1612993210</dateline>
<script></script>
<line>0</line>
<type>20</type>
<friendly_type>MyBB SQL Error</friendly_type>
<message>SQL Error: 1364 - Field 'newpoints_items' doesn't have a default value
Query: 
INSERT
INTO mybbje_users (`username`,`password`,`salt`,`loginkey`,`email`,`postnum`,`threadnum`,`avatar`,`avatartype`,`usergroup`,`additionalgroups`,`displaygroup`,`usertitle`,`regdate`,`lastactive`,`lastvisit`,`website`,`icq`,`skype`,`google`,`birthday`,`signature`,`allownotices`,`hideemail`,`subscriptionmethod`,`receivepms`,`receivefrombuddy`,`pmnotice`,`pmnotify`,`showimages`,`showvideos`,`showsigs`,`showavatars`,`showquickreply`,`showredirect`,`tpp`,`ppp`,`invisible`,`style`,`timezone`,`dstcorrection`,`threadmode`,`daysprune`,`dateformat`,`timeformat`,`regip`,`language`,`showcodebuttons`,`sourceeditor`,`buddyrequestspm`,`buddyrequestsauto`,`away`,`awaydate`,`returndate`,`awayreason`,`notepad`,`referrer`,`referrals`,`buddylist`,`ignorelist`,`pmfolders`,`warningpoints`,`moderateposts`,`moderationtime`,`suspendposting`,`suspensiontime`,`coppauser`,`classicpostbit`,`usernotes`,`ougc_awards`)
</message>
<back_trace>#0  errorHandler->error() called at [/inc/db_mysqli.php:597]
#1  DB_MySQLi->error() called at [/inc/db_mysqli.php:337]
#2  DB_MySQLi->query() called at [/inc/db_mysqli.php:370]
#3  DB_MySQLi->write_query() called at [/inc/db_mysqli.php:830]
#4  DB_MySQLi->insert_query() called at [/inc/datahandlers/user.php:1192]
#5  UserDataHandler->insert_user() called at [/member.php:383]
</back_trace>
</error>
I've taken out the info of the user for privacy reasons.

If you know why this is happening, please let me know, or a fix-it will be great. I tried to remove a plugin I added last month, which didn't cause the issue. 

Thanks Smile

PHP Version 7.3.23
5.7.33 - MySQL Community Server (GPL)
You're using MySQL in strict mode (which is now the default), so you have to alter the mybbje_users.newpoints_items column to have a default value.
(2021-02-10, 09:51 PM)Kojixus Wrote: [ -> ]If you know why this is happening, please let me know, or a fix-it will be great. I tried to remove a plugin I added last month, which didn't cause the issue. 

Thanks Smile

I am assuming by the issues identifying the plugin and sorta also identifying vers in question was say perhaps newpoints shop 1.7 or similar time period and or close to such of plugin? if so most of those related issues in 1.7 are easy to sort out by like say 2 alter table edits, 1 create table edits, a few of acp buttons edits and noted radios, etc, etc...

example of some basic things that are things one would have to touch on and such etc, etc, just for an example sake:
	$db->write_query("ALTER TABLE `".TABLE_PREFIX."users` ADD `newpoints_items` TEXT NOT NULL;");
	$db->write_query("ALTER TABLE `".TABLE_PREFIX."newpoints_grouprules` ADD `items_rate` DECIMAL(6,3) NOT NULL default 1.000;");

	//$db->write_query("ALTER TABLE `".TABLE_PREFIX."users` ADD `newpoints_items` TEXT NOT NULL;");

	//$db->write_query("ALTER TABLE `".TABLE_PREFIX."newpoints_grouprules` ADD `items_rate` DECIMAL(3,3) NOT NULL default '1';");



	  // `price` DECIMAL(16,2) NOT NULL default '0',

      `price` DECIMAL(16,2) NOT NULL default 0.00,



    //$buttons = "";
    $buttons = array();


    		//$form_container->output_row($lang->newpoints_shop_addedit_cat_expanded, $lang->newpoints_shop_addedit_cat_expanded_desc, $form->generate_yes_no_radio('expanded', 1, true, "", ""), 'expanded');


			$form_container->output_row($lang->newpoints_shop_addedit_cat_expanded, $lang->newpoints_shop_addedit_cat_expanded_desc, $form->generate_yes_no_radio('expanded', 1), 'expanded');

etc, etc...

ie: 1.7 edited and using newpoints 2.1.2
[Image: Plugins.png]

but I am not sure why one would want to do that on an outdated version when the actual current plugin is in say v1.9.4 and works well with np 2.1.2 without such issues and is freely avail via auth site?


ie: 1.9.4 not at all edited and using newpoints 2.1.2
[Image: Plugins-1.png]
(2021-02-11, 02:10 AM)censor_deeznutz Wrote: [ -> ]
(2021-02-10, 09:51 PM)Kojixus Wrote: [ -> ]If you know why this is happening, please let me know, or a fix-it will be great. I tried to remove a plugin I added last month, which didn't cause the issue. 

Thanks Smile

I am assuming by the issues identifying the plugin and sorta also identifying vers in question was say perhaps newpoints shop 1.7 or similar time period and or close to such of plugin? if so most of those related issues in 1.7 are easy to sort out by like say 2 alter table edits, 1 create table edits, a few of acp buttons edits and noted radios, etc, etc...

example of some basic things that are things one would have to touch on and such etc, etc, just for an example sake:
	$db->write_query("ALTER TABLE `".TABLE_PREFIX."users` ADD `newpoints_items` TEXT NOT NULL;");
	$db->write_query("ALTER TABLE `".TABLE_PREFIX."newpoints_grouprules` ADD `items_rate` DECIMAL(6,3) NOT NULL default 1.000;");

	//$db->write_query("ALTER TABLE `".TABLE_PREFIX."users` ADD `newpoints_items` TEXT NOT NULL;");

	//$db->write_query("ALTER TABLE `".TABLE_PREFIX."newpoints_grouprules` ADD `items_rate` DECIMAL(3,3) NOT NULL default '1';");



	  // `price` DECIMAL(16,2) NOT NULL default '0',

      `price` DECIMAL(16,2) NOT NULL default 0.00,



    //$buttons = "";
    $buttons = array();


    		//$form_container->output_row($lang->newpoints_shop_addedit_cat_expanded, $lang->newpoints_shop_addedit_cat_expanded_desc, $form->generate_yes_no_radio('expanded', 1, true, "", ""), 'expanded');


			$form_container->output_row($lang->newpoints_shop_addedit_cat_expanded, $lang->newpoints_shop_addedit_cat_expanded_desc, $form->generate_yes_no_radio('expanded', 1), 'expanded');

etc, etc...

ie: 1.7 edited and using newpoints 2.1.2
[Image: Plugins.png]

but I am not sure why one would want to do that on an outdated version when the actual current plugin is in say v1.9.4 and works well with np 2.1.2 without such issues and is freely avail via auth site?


ie: 1.9.4 not at all edited and using newpoints 2.1.2
[Image: Plugins-1.png]
Everything is up to date  Rolleyes

(2021-02-10, 11:18 PM)Crazycat Wrote: [ -> ]You're using MySQL in strict mode (which is now the default), so you have to alter the mybbje_users.newpoints_items column to have a default value.
Thanks Smile Fixed it