Okay well all if not lost
I just had this happen to a guy a few days ago.
Do the following. These are sql queries from Threads admin panel.
1.
DROP TABLE w3t_Category
2.
CREATE TABLE `w3t_Category` (
`Cat_Title` varchar(120) NOT NULL default 'General Discussion',
`Cat_Number` int(9) unsigned NOT NULL default '0',
`Cat_Description` text,
`Cat_Type` varchar(10) NOT NULL default 'forum',
KEY `indx1` (`Cat_Title`),
KEY `indx2` (`Cat_Number`),
KEY `type_ndx` (`Cat_Type`)
) TYPE=MyISAM;
3. Then in your admin panel you can recreate your categories.
If you go to EDIT FORUMS you will notice that the category names are listed with forums underneath still. So jot down the categories in order as the forums are displayed in order under the proper cat order in the edit window. Now go to create categories and create them one at a time in the order you wrote them down. All should be well and working for you now.
This is the way to do it if you have no backups. I suggest you do backups from now on to be safe. You never know when your going to lose the user or post tables under something like this.