I create universal function for insert in Oracle database but is not working correctly.
function Insert($conn,$sqlText,$arrayInput){
if (!$conn) {
$e = oci_error();
trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR);
}
$stid = oci_parse($conn,$sqlText);
// echo '<pre>' . print_r($arrayVariables, true) . '</pre>';
foreach($arrayInput as $key=>$var)
{
// echo 'varable='.$key.'<br/>'.'value='.$var.'</br>';
oci_bind_by_name($stid,$key,$var);
}
oci_execute($stid);
oci_commit($conn);
oci_free_statement($stid);
oci_close($conn);
}
Any idea why is not working? I cant find way to see what is sending to oracle by executing oci_execute($stid);. or what is binded