Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Help! Error when adding new cats

Quote Reply
Help! Error when adding new cats
My site seems to have a big problem! Adding a new link works just fine, but adding a new category gives an error message similar to:

----
Unable to add category: + Failed to execute query: 'INSERT INTO Category (FatherID,Meta_Description,Meta_Keywords,Footer,JACS,Newest_Link....,Category_Template,Header,ID) VALUES(?,?,?,?,?,?,?,?,?,?,NULL)' Reason: Column 'ID' cannot be null
----

There are quite a few extra fields that I've added to the table (hence the ... above to save space). But the ?,?,?,?,?,NULL thing looks as if Links SQL is wiping all my new category information before attempting to write it to the database.

I've done a rebuild and reindex, but no joy. Everything else works fine, ie the rebuilt site works OK and the category table looks fine when I browse it. It's just that I can't add any new categories.

I don't know when this problem started, because I've been doing lots of stuff on the site recently yet I haven't added any new categories. But as far as I know, I can't think what might be causing this.

I have another instance of Links SQL running on the same server, for test purposes, and that one works fine. So it's nothing wrong with the mysql installation on the server.

I'd really appreciate some help here. Thanks!

Rob
Quote Reply
Re: [RobSchifreen] Help! Error when adding new cats In reply to
Have you changed the properties of the 'ID' field in Database > Category > Properties ?

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Help! Error when adding new cats In reply to
No, I haven't changed any of the field properties for the existing fields.

Robert
Quote Reply
Re: [RobSchifreen] Help! Error when adding new cats In reply to
try

admin->setup->SQL-> and select the bottom option.

Or

admin->database->category->properties->resync table


See if that works. The top line resyncs all tables, the second just resyncs the category.


PUGDOG´┐Ż Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [pugdog] Help! Error when adding new cats In reply to
I think, after 2 days of thinking and experimenting, that I know what's gone wrong!

I have written some php scripts to do some big manipulations on the category table, such as changing certain spellings of things. Rather than working on the live table, I copy the table to "test" and work on that one, then copy the table back again afterwards.

To copy the table, I go into phpMyAdmin and do "create table test select * from category".

I have now realised that, although this copies the data, it loses all the indexes and also loses the auto_increment from the ID field.

I have reverted to an old backup database from before I started with the PHP. All is working again. So I shall amend the php to work on the live file and try again.

Luckily for me, one of the first things I did when setting up the system was create a cron job that backs up the database every morning and evening!

Robert