bea
Active Member
Hi,
I've a problem to get the value of check-boxes (4) with form PHP into the next record with insert query.
Error message::
Now only first check appears in next record. Others are ignored. var_dump output:
All other elements, like dropdown, joins, fields work correct:
Cheers,
Bianka
I've a problem to get the value of check-boxes (4) with form PHP into the next record with insert query.
PHP:
$security_checks =$formModel->getElementData('fab_cp1_line_tour___security_checks',true);
var_dump output:Unknown column 'Array' in 'field list'
array(2) { [0]=> string(1) "1" [1]=> string(1) "2" }
PHP:
$security_checks =$formModel->getElementData('fab_cp1_line_tour___security_checks',true);
$security_checks=is_array($security_checks) ? $security_checks[0] : $security_checks;
string(1) "1"
All other elements, like dropdown, joins, fields work correct:
PHP:
$security_status =$formModel->getElementData('fab_cp1_line_tour___security_status',true);
$security_status=is_array($security_status) ? $security_status[0] : $security_status;
PHP:
if($record[0] == 1 && $status[0] == 2 ){
$newstatus= '1';
$newrecord = '1';
$query=$mydb->getQuery(true);
$query->insert('fab_cp1_line_tour')
->set('machine = '.$mydb->quote($machine))
->set('status = '.$mydb->quote($newstatus))
->set('record = '.$mydb->quote($newrecord))
->set('security_status = '.$mydb->quote($security_status))
->set('security_checks = '.$mydb->quote($security_checks));
$mydb->setQuery($query);
$mydb->execute();
$id=$mydb->insertid();
}
Cheers,
Bianka
Last edited: