Buy Now
Sign in

How to validate email in Wordpress DB (check if email already exist)??

pierpul , May 16 2017, 23:39
pierpul 5
May 16 2017, 23:39 #368255
Hi GreyHead, how are you?
I want validate email field in Wordpress Chronoforms form.
If email already exist -> event loop and Display Message "eMail alreasy exist"
If no, DB Save etc etc

This is my script, but don't work:

global $wpdb;

$user = wp_get_current_user();

$query = $wpdb->get_results(" SELECT user_email FROM 'wpds_cf_studente' WHERE 'user_login' = '$user'");

if ($query) {
return "fail"; // user email already registered
} else {
return "success";


In forums there are many examples for Joomla, but not for Wordpress....

Can you help me?


pierpul 5
May 18 2017, 11:03 #368301
I've put above script in Event Switcher. please, can you help me?
Probably there is problem/issue with custom code in "on success" event switcher…