Affiliate plugin database query errors

We're using Affiliate 3.1.6.7, which is producing lots of errors in our log file. Like this one:
"[21-Sep-2017 10:08:11 Australia/Melbourne] WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '%01.2f, now()) ON DUPLICATE KEY UPDATE uniques = uniques + 0, credits = credits ' at line 1 for query INSERT INTO wp_affiliatedata (user_id, period, uniques, credits, ... "

  • Predrag Dubajic

    Hey Tom,

    Hope you're doing well :slight_smile:

    I was doing some tests on couple of my installations but I was unable to replicate this issue no matter what I try, I also had a chat with the developers about this but we didn't encounter any similar reports about this before.

    While they are checking into this it would be helpful if we could get some more information about your setup, so could you grant us support access to site in question so we can have a closer look at this?
    To enable support access you can follow this guide here:
    https://premium.wpmudev.org/docs/getting-started/getting-support/#chapter-5

    Also, can you tell me if you noticed that specific action is triggering this for you, for example when user enables referral, or when you save specific setting in the plugin etc.

    Can you also try updating your plugin to latest version, this should re-save the database entries and might be enough to get this sorted out?

    Best regards,
    Predrag

    • Dexter

      I am also experiencing this issue.

      WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '%01.2f, now()) ON DUPLICATE KEY UPDATE signups = signups + 0, credits = credits ' at line 1 for query INSERT INTO wp_affiliatedata (user_id, period, signups, credits, lastupdated) VALUES (165, '201709', 1, %01.2f, now()) ON DUPLICATE KEY UPDATE signups = signups + 0, credits = credits + %01.2f made by do_action('wp_ajax_nopriv_check_prosite_blog'), WP_Hook->do_action, WP_Hook->apply_filters, ProSites_Model_Registration::ajax_check_prosite_blog, ProSites_Helper_Registration::signup_blog, wpmu_create_user, wp_create_user, wp_insert_user, do_action('user_register'), WP_Hook->do_action, WP_Hook->apply_filters, affiliate->user_register, do_action('affiliate_signup'), WP_Hook->do_action, WP_Hook->apply_filters, affiliate->record_signup

      It has also broken the plugin, meaning that it is no longer showing clicks, or referrals, even though debugging shows that the cookie is properly set.

      I am thinking it could be caused by WP 4.8.2. I created a clean multisite test site, and Affiliates does not work on it still.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.