$var: ${$var}
"; } if ($actname == 'select_project_type') { // echo "select_project_type"; $retarr = array(); $algos = algoList('project_type', $pt_id); //echo $pt_id; echo json_encode($algos); } function algoList($condition_target, $target_id) { global $link; $str = "select * from algo a join algo_conditions ac on a.condition_id = ac.c_id and ac.condition_target='$condition_target' join algo_actions aa on aa.a_id=a.action_id where a.condition_value_id = $target_id"; $query = mysqli_query($link, $str); for ($data = []; $row = mysqli_fetch_object($query); $data[] = $row); return $data; }