Hi folks...
I'd like chronoforms to update an already existing record in my table.
For doing this i've tried to set a query to find the requested cf_id of my record:
It works...
Now I want chronoforms to select from my table the record where cf_id = $cf_id and update the column class_gen_barattoli_dd with a value (100).
I've tried to write down this but it doesn't work.
Every time i submit my form it always creates a new record and saves only $cf_id.
Any idea?
Thanks.
I'd like chronoforms to update an already existing record in my table.
For doing this i've tried to set a query to find the requested cf_id of my record:
<?php
$db =& JFactory::getDBO();
$query = "
SELECT `cf_id`
FROM `#__chronoforms_my_table`
WHERE `check4` != '' AND `radio0` = 'F' AND `cat_barattoli` = 'D' AND `rifiuto_barattoli` = ''AND `edizione_anno` = '$anno_impostato'
ORDER BY somma_pts_barattoli DESC, date_int ASC
LIMIT 1
";
$db->setQuery($query);
$cf_id = $db->loadResult();
?>
It works...
Now I want chronoforms to select from my table the record where cf_id = $cf_id and update the column class_gen_barattoli_dd with a value (100).
I've tried to write down this but it doesn't work.
<?php
$db =& JFactory::getDBO();
$query = "
UPDATE `#__chronoforms_iscrizioni_olimpiadi`
SET `class_gen_barattoli_dd` = '100'
WHERE `cf_id` = '$cf_id'
";
?>
Every time i submit my form it always creates a new record and saves only $cf_id.
Any idea?
Thanks.