MyBB Community Forums

Full Version: 1364 - Field 'thx' doesn't have a default value
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
When I Submit Registration This Sql Error Showing..
I Uninstall All Plugin But Problem Not Solve Kindly Help Me..
See ScreenShoot For More

Forum Url : http://www.tezforum.com/forum/

[attachment=36456]
Moved to Plugin Support.
It looks like you have a Thanks plugin installed, if you don't want that plugin you can remove the 'thx' column from the mybb_users table, or if you do want the plugin, you'll need to set a default value for the column. You can do both of these things in phpMyAdmin.
how can i do this Tell Me Step By Step

anyone help me
Hello
I have the same problem
Explain one person clearly
It is due strict mode enabled. Try another plugin related to thanks system.

Use thankyou mybb system.

Upload files and you have to uninstall it.

Click install then uninstall.

Now try it and problem have to go. Even you can install system to use it or do not.
hello , i have this problem after upgrade my forum from 1.8.22 to 1.8.23 When the user registers

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

I removed the plugin and reinstalled it but the problem was not resolved. Can you help me?
I use the following attached plugin.There is a problem when the plugin is active

[attachment=43169]
You have to modify the plugin to add default values:
function thx_install()
{
	global $db;
	
	$db->query("CREATE TABLE IF NOT EXISTS ".TABLE_PREFIX."thx ( 
		txid INT UNSIGNED NOT NULL AUTO_INCREMENT, 
		uid int(10) UNSIGNED NOT NULL, 
		adduid int(10) UNSIGNED NOT NULL, 
		pid int(10) UNSIGNED NOT NULL, 
		time bigint(30) NOT NULL DEFAULT '0', 
		PRIMARY KEY (`txid`), 
		INDEX (`adduid`, `pid`, `time`) 
		);"
	);
	
	if(!$db->field_exists("thx", "users"))
	{
		$sq[] = "ALTER TABLE ".TABLE_PREFIX."users ADD `thx` INT NOT NULL DEFAULT , ADD `thxcount` INT NOT NULL DEFAULT 0, ADD `thxpost` INT NOT NULL DEFAULT 0";
	}
	elseif (!$db->field_exists("thxpost", "users"))		
	{
		$sq[] = "ALTER TABLE ".TABLE_PREFIX."users ADD `thxpost` INT NOT NULL DEFAULT 0";
	}
	
	if($db->field_exists("thx", "posts"))
	{
		$sq[] = "ALTER TABLE ".TABLE_PREFIX."posts DROP thx";
	}
	
	if(!$db->field_exists("pthx", "posts"))
	{
		$sq[] = "ALTER TABLE ".TABLE_PREFIX."posts ADD `pthx` INT(10) NOT NULL DEFAULT 0";
	}
	
	if(is_array($sq))
	{
		foreach($sq as $q)
		{
			$db->query($q);
		}
	}
}

Modified file is in post #10
thanks. The problem was fixed
I didn't look at every fields, sorry.
Here is the new modified one.
Pages: 1 2