WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] “WordPress database error: [Duplicate entry ‘30280’ for key 1]” – Help!

[Resolved] “WordPress database error: [Duplicate entry ‘30280’ for key 1]” – Help!

  • I checked my site this morning and was presented with a ton of errors, rendering the whole website pretty much useless. The main error seems to be:

    WordPress database error: [Duplicate entry ‘30280’ for key 1]
    SELECT DISTINCT YEAR(post_date) AS year, MONTH(post_date) AS month, count(ID) as posts FROM wp_posts WHERE post_date < ‘2005-08-10 10:56:35’ AND post_status = ‘publish’ GROUP BY YEAR(post_date), MONTH(post_date) ORDER BY post_date DESC

    as well as these errors for my Poll:

    WordPress database error: [Duplicate entry ‘30280’ for key 1]
    SELECT id, question, total_votes FROM wp_pollsq ORDER BY id DESC LIMIT 1

    WordPress database error: [Duplicate entry ‘30280’ for key 1]
    SELECT aid, answers, votes FROM wp_pollsa WHERE qid = ORDER BY votes DESC

    I’m still pretty much a WordPress novice and I have no idea at all about what these errors means. I’ve used MySQLAdmin to repair the offending tables, but this hasn’t helped. Any help would be hugely appreciated – thanks!

Viewing 8 replies - 1 through 8 (of 8 total)
  • What happens if you de-activate your voting plugin?

    If I turn off the plugin I get a blank page with this error on it:

    Fatal error: Call to undefined function: vote_poll() in /home/virtual/site79/fst/var/www/html/wp-content/themes/default/header.php on line 2

    I tried removing the snippet of PHP code which calls the poll, but strangely the above error still remains. However, if I remove “<?php vote_poll(); ?>” from the header then it goes back to the original page, with the original ‘WordPress database error’ on. This is getting more confusing by the second :/

    UPDATE:
    OK, I’ve removed everything to do with the Poll system from my template, and whilst there are no errors on the main index page the same errors appear whenever I try to access a Page (WordPress’ definition of a page, not a html page that I have created myself). Could this have something to do with the way WordPress archives Pages? Anyone?

    Anybody? I’ve seen this error mentioned before but nobody has a definite answer. Any help would be appreciated, thanks!

    OK, I think I’m getting somewhere. Turns out it was a combination of ShortStats and the Poll plugin that was causing the errors; I’ve removed the offending PHP from the template until I can work out what was causing them. However, I still get this same error:

    Fatal error: Call to undefined function: vote_poll() in /home/virtual/site79/fst/var/www/html/wp-content/themes/default/header.php on line 2

    on any wordpress Page I try to access on my site. I’m pretty sure this has something to do with the way WordPress archives pages, but does ANYBODY have any way they can help me here?

    Edit your header.php file and make sure that the vote_poll() function has been removed.

    WordPress doesn’t archive pages unless you’re using a caching plugin. WordPress dynamically generates pages for display when a user requests it.

    Thanks for your help skippy. I had removed the code from my main header.php file, however I looked around my webspace and came across an older version of the file which still had the code in from when I had my WordPress set up within a subfolder. I didn’t think it would affect it anymore but hey, it did. Removed it and everything seems to be working fine. Sorry for wasting your time, and thanks again for your help 🙂

    No time wasted at all! I’m glad the problem was resolved (even if not necessarily fixed).

    To truly fix the problem, you might need to drop the tables used by your poll script and shortstats, and start over with both of them.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘[Resolved] “WordPress database error: [Duplicate entry ‘30280’ for key 1]” – Help!’ is closed to new replies.
Skip to toolbar