Custom database query

susans 26 Nov, 2012
I would like to set up a multi-page form with the following data flow:
The first page requests the information that will uniquely identify a record
When the user clicks on the submit button on the first page I would like to do the following:
Do a database lookup to see if a record already exists with the submitted information
If the record exists I would like to read in the record and populate the rest of the pages with the information that was retrieved from the database
If the record does not exist I would like to save the data to the database and proceed to allow the user to complete the rest of the form.

How would I go about doing that?

Thanks
susans 26 Nov, 2012
OK, I figured this out. You need to use a Load DB Record action. On the advanced tab you specify the where clause using the data from the form (e.g. $form->data['first_name']). However, on the basic tab you still need to specify a parameter and a database column even though the where clause overrides them.
GreyHead 26 Nov, 2012
Hi Susans,

I can't replicate this, if I leave the DB Field and Request Param boxes empty the WHERE clause appears to work OK.

Bob
This topic is locked and no more replies can be posted.