I have a calendar application and the table that keeps all events is named as ProjCalend
I want to have a function what will make a copy of all recent added events added to the calendar into another table, named ProjCalendHistory that is a perfect clone of ProjCalend.
Then, I went to onAfterInsert event into the calendar and added the following functions:
sc_exec_sql(INSERT INTO ProjCalendHistory VALUES (id,title,description,event_color,category,start_date,end_date,start_time,end_time,calend_all_day,creator,creation_date_time))
sc_exec_sql(SELECT id,title,description,event_color,category,start_date,end_date,start_time,end_time,calend_all_day,creator,creation_date_time FROM ProjCalend)
sc_exec_sql(WHERE id=(SELECT max(id) FROM ProjCalend))
However, as I run the calendar application I get the following error:
Parse error : syntax error, unexpected ‘INTO’ (T_STRING), expecting ‘)’ in /opt/NetMake/v9-php73/wwwroot/scriptcase/…
I tried a lot of things, but had no success.
Any suggestion is welcome.
Thanks.
Daniel.