News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Duplicate entry '255' for key 'PRIMARY'

Started by just_visiting, October 01, 2014, 09:02:09 PM

Previous topic - Next topic

just_visiting

Hi,

I've received this error while attempting to create a new category.  No updates/upgrades have occurred to the form.  The error also references the /Sources/Subs-Categories.php location.  I performed a clean install of SMF 2.0.8 and imported the database with the same result.  Here are the lines of code close to the :


// Add the category to the database.
   $smcFunc['db_insert']('',
      '{db_prefix}categories',
      array(
         'name' => 'string-48',
      ),
      array(
         $catOptions['cat_name'],
      ),
      array('id_cat')
   );

Arantor

How many categories do you have? SMF is only designed to support 255 categories maximum (and deleting and creating new ones count towards that)

just_visiting

Looks like when you hit the 255 number, you're done.  Even deleting the oldest categories doesn't help.  Only deleting the newest gives you the ability to add a new one.....grrrrr

Arantor

Yes, like I said... deleting existing ones count towards that.

How many categories do you have and how many do you actually *need*?

just_visiting

Looks like we can delete at least half of the categories

Arantor

So edit some of the categories you already have and reuse them rather than making new ones.

Please note for future reference... being vague in answers rarely gets you anything useful. There are people who know the code inside out here and they ask specific questions expecting specific answers, because they know it's relevant, and vagueness just tends to annoy them by them having to ask more questions.

just_visiting

I'll definitely try renaming existing!!!!!!!!

Thanks for the info!

Advertisement: