Well, I would check your linksid.txt and categoryid.txt for the following:
1) Make sure that the number in the file matches the number of the last record in your .db files.
2) Make sure that the permission of these files are set to 666 (rw-rw-rw-).
I would also check your .db files and make sure that you have ID numbers for each record.
Regards,
Eliot Lee