NUM error

3 posts by 3 authors in: Forums > CMS Builder
Last Post: August 12, 2010   (RSS)

By s2smedia - August 12, 2010

I am an idiot.. I accidentally renamed the field_name for "num" in the user accounts viewer.

now Im getting an error and it wont me change it back..

and quick fixes are appreciated..

get this errow when I try to change it back to "num"

Notice: Undefined index: num in /home/apexsocc/club_ambassador/pages/login/lib/admin_functions.php on line 506
There was an error creating the MySQL Column, the error was:

Incorrect table definition; there can be only one auto column and it must be defined as a key

Re: [Jason] NUM error

By Chris - August 12, 2010

Oh wow, we really shouldn't allow people to do that!

I tried this out to see if I could recover from it and it's not looking pretty. Rather than renaming the num field, it was dropped entirely. If you don't have a backup, your CreatedByUserNum and UpdatedByUserNum fields in your other tables are likely going to be corrupt.

I modified my accounts.ini.php as Jason recommended above, but I also had to run an SQL query to add my num field back, since I was trying to recover without using a backup:

ALTER TABLE cms_accounts ADD COLUMN `num` int(10) unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT;

This resulted in all my user accounts being assigned fresh nums. Depending on how you've set up your CMS Builder tables, (specifically, whether you're relying on account nums for anything,) this could either be devastating or of no concern at all!
All the best,
Chris