• Resolved intuitart

    (@intuitart)


    Woocommerce version 3.2.3
    AffiliateWP version 2.1.7
    Show affiliate coupons version 1.0.6

    I’m getting a WP database error when accessing the site and not logged in. Error:

    WordPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ” at line 4]
    SELECT post_id FROM wp_postmeta WHERE ( meta_key = ‘affwp_discount_affiliate’ OR meta_key = ‘affwp_coupon_affiliate’ ) AND meta_value =

    I can avoid the error by returning from get_coupons() function early if there is no $affiliate_id. That is:

    replace

    $affiliate_id = affwp_get_affiliate_id()

    with

    if ( ! $affiliate_id = affwp_get_affiliate_id() ) {
    	return false;
    }

    Hope this helps,

    Andrew P.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)

The topic ‘Database error’ is closed to new replies.