Aug 5th, 2009, 4:45 AM
(Aug 1st, 2009, 9:28 AM)Ben Wrote: Also: I'm pretty sure the code requires your form fields to have the same database column names. I.e. your email field has a name attribute of "attendee_email" AND your database column for that field has the same value. I've always done this - had a 1-1 relation between form field names and database column names. It just makes working with the database that much simpler. You don't HAVE to do this, but you may have to review the code to ensure it's all okay.
Ben, Many thanks for this code and your detailed instructions.
I've managed to use the login.php form to successfully log in and take me to the first page of my form. However when the form opens it doesn't load the data into the $fields array as I was hoping. I think this is because the array data loaded from login.php uses the field names taken from the database columns eg col_1, col_2, col_3 eg
Array ( [col_1] => John [col_2] => Doe [col_3]=> 34)
whereas the $fields aray uses field names from my form eg
Array ( [first_name] => John [last_name] => Doe [age]=> 34)
I think this is what you refer to in the above quote - is that right?
If so, how do I fix this? Do I need to manually change all the column titles in the database to match my form (a very long process!!) or is there a way to change the code of formtools so that when I first initialise my form it automatically uses the field name on my form for the column titles instead of col_x?
I hope I have made sense!
Thanks again