I’m trying to update one table with data from another.
I want to get a default checklist depending on the type of check.
I thought (I know) that I could use sc_exec_sql macro to do this but I’m getting the following message no matter what!
The sql (Which works nicely when executed in Mysql) I want to execute is:
SET foreign_key_checks = 0;
INSERT INTO proj_rev_checklist (proj_rev_def_list_proj_rev_def_list_id, proj_proj_id)
SELECT proj_rev_def_list_proj_rev_def_list_id, 1
FROM proj_rev_def_list_has_proj_rev_type WHERE proj_rev_type_proj_rev_type_id = 1;
SET foreign_key_checks = 1;
Now I have deleted everything and I only have the below in my form under events ‘OnScriptInit’ …
$sqlstring1 = “”;
$sqlstring2 = “”;
$sqlstring3 = “”;
/*
- This macro execute SQL commands passed as parameter or a SQL command in the SQL field action type.
*/
sc_exec_sql("$sqlstring1")
sc_exec_sql("$sqlstring2")
sc_exec_sql("$sqlstring3")
…
It returns the following error:
Parse error: syntax error, unexpected ‘;’ in C:\Program Files (x86)\NetMake\v81\wwwroot\scriptcase\app\beta\form_projects\form_projects_apl.php on line 2335
I need to make sure this is not a bug and if not could someone please give me a direction on what could be the issue
Thanks …