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?
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?
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.
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.