Dear friends,
I've a form in which a php form plugin is activated. The PHP plugin should store data, from table two-joined tables, into table TEMP_REPORT. The simple code is the following:
$db =& JFactory::getDBO();
$query="INSERT INTO temp_report (user_id, lab_group, act_id) SELECT user_id, lab_group, lesson_days.id FROM `fab_laboptions` LEFT JOIN lesson_days ON fab_laboptions.lab_id = lesson_days.lab_id WHERE lesson_days.id ='1' ";
$db->setQuery($query);
$db->query();
But it desn't work, and no records are copied into TEMP_REPORT List. A problem with the LEFT Join? How to fix?
Thank you.
Cheers,
Roberto
I've a form in which a php form plugin is activated. The PHP plugin should store data, from table two-joined tables, into table TEMP_REPORT. The simple code is the following:
$db =& JFactory::getDBO();
$query="INSERT INTO temp_report (user_id, lab_group, act_id) SELECT user_id, lab_group, lesson_days.id FROM `fab_laboptions` LEFT JOIN lesson_days ON fab_laboptions.lab_id = lesson_days.lab_id WHERE lesson_days.id ='1' ";
$db->setQuery($query);
$db->query();
But it desn't work, and no records are copied into TEMP_REPORT List. A problem with the LEFT Join? How to fix?
Thank you.
Cheers,
Roberto