When I call a form I pass some parameters via url. One of them is the fieldname of a database where I want to store a number.
Is it possible in CF6 to use a variable as fieldname?
Is it possible in CF6 to use a variable as fieldname?
Hi Bournell,
The calling URL variables are added to the form data by ChronoForms - if you temporarily add a Debugger action you will see them there. Please see this FAQ for the corresponding short-codes.
Bob
The calling URL variables are added to the form data by ChronoForms - if you temporarily add a Debugger action you will see them there. Please see this FAQ for the corresponding short-codes.
Bob
I don't think you can use a variable to replace the field name, but it would take you mere seconds to try.
I spent nights to find it out - no chance.
BUT
I want to use a php-block with this code:
BUT
I want to use a php-block with this code:
$start = $_GET["zeit"]; // These are the parameter I pass tu the Form via url
$position = $_GET["pos"];
$team = $_GET["team_nr"];
$db =\JFactory::getDbo();
$query = $db->getQuery(true);
$query -> update ('#__3s_starts') // this is my table where
-> set ("$position=$team") // I want to put the team-number
-> where ('Zeit='.$start); // at this specific time.
$db->setQuery($query);
echo $query->dump(); //for testing purpose
$db->close();
The Query-Dump :
UPDATE svt38_3s_starts SET Position1=63 WHERE Zeit=1567927800But it does not work inside CF. Nothing will be written into the DB. ( It's possible to read from DB.) Pleeeze give me a hint....
OK so I don't see there where you actually EXECUTE the query?
Yesss. it works. I was to blind to see......I just added:
$db->execute();Thanks a lot. Now I can sleep better ;-)
This topic is locked and no more replies can be posted.