Nov 14th, 2010, 7:50 AM
Ok, sorry if this is already answered in docs, but I couldn't find explicit examples, and want to make sure I am in the ballpark..
I have a form I have created to submit values to an existing database, but I need these values in separate tables. Can I do this using the $fields array and a sql statement?
example form header:
require_once("../formtools/global/api/api.php");
$fields = ft_api_init_form_page(1);
$params = array(
"submit_button" => "add_intake",
"next_page" => "thanks.php",
"form_data" => $_POST,
// "file_data" => $_FILES,
"finalize" => true
);
ft_api_process_form($params);
?>
then do my insert into sql based on $fields['field_name']
$qresult = mysql_query("update table where key = $fields['key]");
if (mysql_num_rows($qresult) == 0)
{
basically, I want to map the fields in the form to an existing database rather than using the formtools ft_ tables..
Would it make more sense to just link the ft_ table to my existing table instead and do some kind of post-processing thing?
Sorry if this is unclear or a stupid question, I am a bit new to this.
would I do this as part of the form itself or could I separate this code?
I have a form I have created to submit values to an existing database, but I need these values in separate tables. Can I do this using the $fields array and a sql statement?
example form header:
require_once("../formtools/global/api/api.php");
$fields = ft_api_init_form_page(1);
$params = array(
"submit_button" => "add_intake",
"next_page" => "thanks.php",
"form_data" => $_POST,
// "file_data" => $_FILES,
"finalize" => true
);
ft_api_process_form($params);
?>
then do my insert into sql based on $fields['field_name']
$qresult = mysql_query("update table where key = $fields['key]");
if (mysql_num_rows($qresult) == 0)
{
basically, I want to map the fields in the form to an existing database rather than using the formtools ft_ tables..
Would it make more sense to just link the ft_ table to my existing table instead and do some kind of post-processing thing?
Sorry if this is unclear or a stupid question, I am a bit new to this.
would I do this as part of the form itself or could I separate this code?