• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: Checking for duplicate emails in Joomla validation

Checking for duplicate emails in Joomla validation 13 years 6 months ago #11910

Hi

I have RSForms creating new Joomla accounts and various other odds and ends (unique username, merging First Name and Last name etc).

All is fine.

However, I am trying to modify the function for checking email address duplications so that it looks in Joomla.

It doesn't work though.

The field in RSForms for emails is: email

Any ideas?
function unique($param, $extra=null)
{
if(!RSFormProValidations::email($param,null))
return false;
$db = JFactory::getDBO();
$param = $db->getEscaped($param);
$db->setQuery("SELECT `id` FROM #__users WHERE `FieldName`='email'");
$db->query();
$invalid = $db->getNumRows();
if ($invalid)
return false;
return true;
}
The administrator has disabled public write access.

Re:Checking for duplicate emails in Joomla validation 13 years 6 months ago #11932

Solved:

The RSForms team gave answer:

as the registrations are also present in the RSForm! Pro tables, namely in the Manage Submissions section. If you wish to check the jos_users table for registered users then you will have to change the following code line:

$db->setQuery("SELECT `id` FROM #__users WHERE `FieldName`='email'");

to something like this:

$db->setQuery("SELECT `id` FROM #__users WHERE `email`='".$param."'");

This works for me.
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!