PDA

View Full Version : New categories overwriting old ones


Anonymous
06-14-2005, 10:03 AM
Hi guys

I am running V2 RC3 on my directory and started having weird things happening. I have narrowed it down to the fact that when I add a new category, it is over-writing one that is already there... this is obviously causing categories to disappear and other categories to have strange things under them!!

I imported the database from within Version 1 using your script, and then added the TITLE_URL entries manually so I could use URL Rewrite.

Is there something I've missed, or is this a bug?? Is there an option in the database to prevent ID's that are already being used from then being over-written when a new category is added.

If it is any help, the problem seems to have started by over-writing ID1, and is then working its way up again so it seems to me that even though the PLD_CATEGORY table has the existing category information, something seems to think the ID's are available to be used!

Any help would be very gratefully appreciated!!


Kind Regards
James

Anonymous
06-15-2005, 07:45 AM
Has anyone any ideas on this, because the only way I can add categories at the moment is by manually adding rows into the database, which is a real pain (relative to using the admin panel anyway!)

Thanks
J

David
06-15-2005, 05:12 PM
I've been talking to dcb about this one and you should have your answer soon...sorry for the delay.

Anonymous
06-15-2005, 06:00 PM
Hi there

That's OK, I'm not complaining, just a bit confused! Cant work out why it is doing this and it is frustrating me!!


J

David
06-15-2005, 07:36 PM
There is a way to assign a higher starting number for categories. I just don't know how to do that. dcb will know, and I'm confident he will have the answer soon.

dcb
06-16-2005, 12:30 PM
phpLinkDirectory is built using the ADOdb database abstraction library. Because not all database engines support autoincrement columns (in fact only MySQL and MS SQL do) ADOdb simulates sequences on databases that do not support sequences and uses them where available.

Bottom line is that on MySQL ADOdb creates a table for each autoincrement needed, and for categories it is PLD_CATEGORY_SEQ, so simply look in PLD_CATEGORY and see what is the biggest ID used and update the value in PLD_CATEGORY_SEQ with that.

Anonymous
06-16-2005, 04:12 PM
Excellent!! Thank you, that worked a treat.

The value was "7", which explains a lot. I've set it to 200 and everything is back to normal.

Thanks so much for all your help

roadies
07-12-2006, 04:34 AM
thanks for this! The fix should be added to the "common cures" sticky post for sure.