Sc_exec_sql hangs

schriptcase V 9.6.2
This is a control app

//preparation …
//create buchung record in hu_occupation
$sql5=“INSERT INTO hu_occupation (reserv_id,person_id,res_start_date,res_end_date,occup_key_code,occup_person_name,occup_house_rate, occup_adult_dayrate,occup_child_dayrate,occup_total_rebate) VALUES ($reservId,$personId,’$resStartDate’,’$resEndDate’,’$occupKeyCode’,’$occupPersonName’,$occupHouseRate,$adultDayRate,$childDayRate,$occupTotalRebate)”;
sc_exec_sql($ql5);

Problem: The script hangs in the sql_exec_sql.

Using a echo of $sql5 and executing the mysql statement in database builder->sql commando with the values filled in, it works!
sql Statement: INSERT INTO hu_occupation (reserv_id,person_id,res_start_date,res_end_date,occup_key_code,occup_person_name,occup_house_rate, occup_adult_dayrate,occup_child_dayrate,occup_total_rebate) VALUES (7,2,‘2021-04-17 12:00:00’,‘2021-04-24 12:00:00’,‘1:2:4.8:9’,‘Alex Sager’,35.00, 5.00,2.50,0.66)

WHAT or WHERE could be the problem?

you have $ql5 … not $sql5.

Yes, there is a typing error. On my system, where the scripts hangs, it is correct.
The reason for this error is described in post "invalid sql or macro makes app unrepairable. Therefore if it hangs, just restart the app and try step by step.

Macro and sql errors are not recognised by scriptcase!

I’m afraid that the " ‘$var’ " construction is failing in the SC PHP parser. I would try to fix this issue by rewriting the code as “’”.$var."’"

A bit of a hassle but I think this will work.