Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Abdul Ibad

    (@abdul_ibad)

    Are you activate multi-site?

    Thread Starter MEDKOD

    (@loupio)

    No, no multi-site,

    And, by the way, i’m on wp_debug mode so it desapears when i disable it. But why does it give this error?

    Plugin Author Abdul Ibad

    (@abdul_ibad)

    That’s because $wpdb->signups is empty.
    https://github.com/dulabs/frontend-edit-profile/blob/master/fep.php#L404
    And i’m still searching why this happen.

    Can you tell me, your PHP version and WordPress Version?

    Thread Starter MEDKOD

    (@loupio)

    My php version is 5.6

    Hello
    Use the global $wpdb object.

    Search:

    // Update the email address in signups, if present.
            if ($user->user_login && isset($_POST[ 'email' ]) && is_email($_POST[ 'email' ]) && $wpdb->get_var($wpdb->prepare("SELECT user_login FROM {$wpdb->signups} WHERE user_login = %s", $user->user_login))) {
                $wpdb->query($wpdb->prepare("UPDATE {$wpdb->signups} SET user_email = %s WHERE user_login = %s", $_POST[ 'email' ], $user_login));
            }

    And Replace with:

    // Update the email address in signups, if present.
    		global $wpdb;
            if ($user->user_login && isset($_POST[ 'email' ]) && is_email($_POST[ 'email' ]) && $wpdb->get_var($wpdb->prepare("SELECT user_login FROM {$wpdb->signups} WHERE user_login = %s", $user->user_login))) {
                $wpdb->query($wpdb->prepare("UPDATE {$wpdb->signups} SET user_email = %s WHERE user_login = %s", $_POST[ 'email' ], $user_login));
            }

    Thread Starter MEDKOD

    (@loupio)

    thank’s R.F., hope the developper will do this as soon as possible.

    seancon1

    (@seancon1)

    i added global $wpdb; but still get the error,
    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 'WHERE user_login = 'WPUSER'' at line 1 for query SELECT user_login FROM WHERE user_login = 'WPUSER'

    notice the repeated single quote at the end of the first WHERE. i dont see where this is coming from or if its part of the issue but when i comment out the above code, the error is not present.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Error when updating the form’ is closed to new replies.