• 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: Get data from MySQL database and show in RSForm

Get data from MySQL database and show in RSForm 5 years 4 months ago #39702

  • StormIT
  • StormIT's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 32
Hi,

I'm building an RS Form where a user can enter their email address into the form, but I need the form to then get data from another MySQL database (in localhost) and bring various data back into the form to be displayed, such as address, name etc...

I have split the pages, so page 1 is the email address entry and then page 2 shows that data.

The user can't proceed if they enter a wrong email address.

What's the best way to do this in RSForms please?
The administrator has disabled public write access.

Get data from MySQL database and show in RSForm 5 years 4 months ago #39709

  • adrianp
  • adrianp's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 631
  • Thank you received: 146
Hello,

What you're asking will normally require an AJAX implementation which achieving is rather tricky. You can however consider using two forms that work similarly as follows (although there are 2 forms, this will greatly simplify your implementation):

- have your first form merely input the email address and a submit button.

- when the first form is submitted, redirect to your second form, including a URL parameter that transports the email address. You can place such a redirect within the "Return URL" field where you can also include your email field placeholder (while editing a form > Properties > Form Info).

- use PHP in your other from to capture the URL parameter value and based on it, query the database and pre-fill your form fields with the desired data. Such a script is placed within the "Script called before form is generated" area.

Of course this can be further developed as needed; for example to use a hash instead of the email address in the URL parameter, and based on it, retrieve the email address and then perform your queries.

Various other helpful examples can be found in the FAQ, custom scripting and customizing RSForm!Pro documentation sections.
This is not official customer support. To receive your support, submit a support ticket here.
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!