News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Re: Unable to add new post - database problem

Started by dj_king, July 29, 2024, 07:20:12 AM

Previous topic - Next topic

dj_king

Quote from: Aleksi "Lex" Kilpinen on March 19, 2021, 08:06:57 AMThe "Field 'karma_bad' doesn't have a default value" error is simple really, you just need to assign that field a default value in the database, usually if there is not one set already, NULL will do.


I have the same problem. I deleted the 2 tables that the previous colleague said, and it still gives me the same problem.

I updated my forum from an older version to the latest one, and everything was fine... until I decided to post. Any solution please? A hug and thank you!
SMF 2.0.1

Aleksi "Lex" Kilpinen

If you deleted the table mentioned in the error, there is no possibility that the error is the same. Also, blindly deleting tables is a BAD idea.
If the error is still X "doesn't have a default value", the solution is still to give the mentioned field X a default value. Usually NULL will be fine.
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

dj_king

Well the error is this:

Field 'karma_bad' doesn't have a default value
File: /home/icivjqn/www/foro/Sources/Subs-Post.php
Line: 1897

I don't know how to solve it. I need professional help, even if it costs me money please.
SMF 2.0.1

Aleksi "Lex" Kilpinen

Locate the field in your database, and give it a default value.
Most likely, you would find this field in smf_messages.

You could try running ALTER TABLE smf_messages ALTER karma_bad SET DEFAULT NULL;

If this works, the error will likely change to a different field, that you will need to update as well.
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

dj_king

Quote from: Aleksi "Lex" Kilpinen on July 29, 2024, 07:41:56 AMLocate the field in your database, and give it a default value.
Most likely, you would find this field in smf_messages.

You could try running ALTER TABLE smf_messages ALTER karma_bad SET DEFAULT NULL;

If this works, the error will likely change to a different field, that you will need to update as well.

TRUE.

Now it gave me this other error:

Field 'edit_reason' doesn't have a default value
File: /home/icivjqn/www/foro/Sources/Subs-Post.php
Line: 1897

I understand that they are the mods that I had previously installed and that I no longer have.

Do I have to set them all to NULL? I mean... the errors that I get every time I modify a new error?
SMF 2.0.1

Aleksi "Lex" Kilpinen

Yeah, NULL is a fairly safe non-value. So if any error comes up with "doesn't have a default value", NULL usually works.
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

dj_king

Quote from: Aleksi "Lex" Kilpinen on July 29, 2024, 07:49:43 AMYeah, NULL is a fairly safe non-value. So if any error comes up with "doesn't have a default value", NULL usually works.

yes!!!!

Thank you!

now it works perfect
SMF 2.0.1

Kindred

In the future, please start your own topic rather than piggy backing on someone else's help thread.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Advertisement: