Hi,
I migrated the project from Pligg to Drigg, www.klaku.net, but there is a problem when I write comments on the nodes...
user warning: Duplicate entry '8' for key 1 query: INSERT INTO comments (cid, nid, pid, uid, subject, comment, format, hostname, timestamp, status, score, users, thread, name, mail, homepage) VALUES (8, 3509, 0, 6, 'dankon', 'dankon pro viaj informoj kaj via laboro! :-)', 1, '81.38.27.101', 1202085549, 0, 0, 'a:1:{i:0;i:0;}', '01/', 'dipcas', '', '') in /home/.meta/klaku/klaku.net/pligg/includes/database.mysql.inc on line 172.
Please, I need some help.
Comments
Comment #1
mercmobily commentedHi,
It's a bit late here, but this looks urgent. So, here I am!
This bit of the importer really should take care of it:
// Reset the auto_increment so that it doesn't go bananas
$max=db_result(db_query("SELECT max(cid) FROM {comments}"));
$max ++;
db_query("UPDATE {sequences} set id=%d WHERE name='comments_cid'",$max);
Why didn't it? I don't get it.
Please run this SQL query:
SELECT max(cid) FROM comments
And see what the number is. Then, run:
UPDATE sequences set id=XXXX WHERE name='comments_cid'
Where XXXX is the number you got in the previous query. This should fix the comments.
I still don't understand why it's doing it.
In my defense, writing a Pligg importer was _extremely_ hard, because Pligg's DB structure was very confusing.
Bye,
Merc.
Comment #2
joancatala commentedmercmobily!!!!!! you are my God!!!!!!!!!!!!!
Thanks very much. this solved my problem.
thanks for everything!
joan
Comment #3
mercmobily commentedHi,
Well, I somehow caused the problem in the first place... which is annoying. I just cannot figure out why it didn't work in the first place... meh :-(
Merc.