All new created boards and categories get ID 0

Started by dodos26, April 04, 2021, 09:04:20 AM

Previous topic - Next topic

dodos26

All new created boards and categories get ID 0.
I don't know why this is happening. When I try to create a new category it is given ID 0, When I create another, its name is overwritten, but all names with ID 0 are in the database.
But all names with ID 0 are in the database but as I manually deleted boards and categories now I can't create new board in category 0.

shadav

sounds like your count sync (auto increment) is off (or deleted)

what version of smf is this? was this a fresh install or upgrade and if upgrade how did you upgrade?

try running these sqls in your database

ALTER TABLE `smf_categories`
  MODIFY `id_cat` tinyint(4) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=100;


change the table prefix (smf_) to whatever you used
change at the end there 100 to whatever is your category count +1
so if you have 1 category change that number to 2 and so on....this is telling it what the next number should be when you create a new category

and then do the same for boards
ALTER TABLE `smf_boards`
  MODIFY `id_board` smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=100;


categories = well categories, where you place boards into
boards = the actual boards where you create new posts/topics

Kindred

Do not ever delete things directly in the database....
Сл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."

dodos26

Exactly this was the cause. I managed to discover it. Comparing the new database with the old one. However, when set manually.
This didn't work well as the board was only visible in the admin panel.
I once backed up the board and categories table. And I brought them back and then I haven't added new sections until now.

dodos26

For safety, can you make me a command to repair all indexes?

Advertisement: