• 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: Select value from a DB depending on form field

Select value from a DB depending on form field 6 years 10 months ago #38254

Unfortunately, I couldn't do it myself with the available documentation. I have already used this tutorial to start www.rsjoomla.com/support/documentation/r...st-from-a-table.html but without success.

I would like to enter an email address in a form field and then display a corresponding value from the database after submitting the form (in my case I know that the email address will always be available)

In PHP I got so far that I get the information statically displayed with an email address given in the code. But I would actually like this information to be displayed in the Thank you Message, for example.

So my form has a field: "email" and a submit button only.
When clicking on submit something like this should happen:
$searchstring =???getEmailValueFromEmailFormfield?? ?; 
 
$query = $db->getQuery(true);
// Run the SQL query and store it in $results
$query->select($db->quoteName(array('key', 'email')));
$query->from($db->quoteName('#__acymailing_subscriber'));
$query->where($db->quoteName('email') . = $db->quote($searchstring ));
 
$db->setQuery($query);
$row = $db->loadRow();
Show the content of $row in the Thank you message

Maybe somebody is interested to help me with my problem. Thanks!
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!