WordPress.org

Ready to get started?Download WordPress

Forums

AVH First Defense Against Spam
[resolved] Database error Duplicate entry (6 posts)

  1. FYI, getting lots of these php errors:

    WordPress database error Duplicate entry '625524330' for key 'PRIMARY' for query INSERT INTO wp_avhfdas_ipcache (ip, spam, added, lastseen) VALUES ('625524330', 0, '2013-05-13 09:55:14', '2013-05-13 09:55:14') made by require('wp-blog-header.php'), require_once( [...]

    http://wordpress.org/extend/plugins/avh-first-defense-against-spam/

  2. petervanderdoes
    Member
    Plugin Author

    Posted 1 year ago #

    This happens when the spammers hammer your site. Sometimes they try to post withing one second, the first write to the database hasn't yet completed when the 2nd write is performed.

  3. petesky
    Member
    Posted 1 year ago #

    Hello !

    To avoid this error (while being hammered) :-)

    $result = $wpdb->query($wpdb->prepare("INSERT DELAYED INTO $wpdb->avhfdasipcache (ip, spam, added, lastseen) VALUES (%s, %d, %s, %s)", $ip, $spam, $date, $date) ON DUPLICATE KEY UPDATE ip='$ip',spam='$spam',... );

    http://dev.mysql.com/doc/refman/5.0/en/insert-on-duplicate.html

    Maybe you can update the files , thank you

  4. petesky, this would be good to try; what's the complete code chunk? I tried to adapt what you posted but got errors.

  5. petervanderdoes
    Member
    Plugin Author

    Posted 1 year ago #

    I just released v3.6.1 with the above fix.

  6. Thanks!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.