Buy Now
Sign in

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

pierpul , May 16 at 23:39
p
pierpul

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:

				<?php

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?

Thanks

Matteo

p
pierpul

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…