MyBB Community Forums

Full Version: i am getting SQL error when i want to delete a post permanently.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Whenever i am trying to permanently delete a post
i am getting this type of SQL error.

SQL Error:
1364 - Field 'notes' doesn't have a default value
Query:
INSERT INTO mybb_threads (`dateline`,`lastpost`,`fid`,`subject`,`uid`,`username`,`visible`,`closed`) VALUES (1640685844,1640685844,43,'RE: The best-selling rosin press on ecoarm.ca, Christmas promotion!',1,'PARADOX',1,'yes')

please tell me how can i solve this error.

i fixed it myself by run this query :- 
ALTER TABLE `mybb_threads` CHANGE `notes` `notes` TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '0';
Mark your thread as solved.
It looks like your database structure of table mybb_threads is a little different from what MyBB ships.

By the way, what's the database and the version of it your forums on?
Would probably be better to do this:

ALTER TABLE `mybb_threads` CHANGE `notes` `notes` TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL;

Allowing null makes more sense than setting a default of '0'. I think in newer versions of MySQL you can't set a default on text fields anyway, this confused me a while back as I used to set a default of '' and then it started erroring on newer versions, where what you need to do is just allow null.