Hi need some urgent help!!
I have a php form that is not saving the information to the database, sometimes it does and sometimes it doesnt . I have the assumption the problem must be user error but I really have no idea, hope somebody can help me out. The form is part of an electronic medical record the following is the code:
[php]
<?php include_once("../../globals.php"); include_once("$srcdir/api.inc"); include_once("$srcdir/forms.inc"); $prov = $_SESSION['authUserID']; $enc = $_SESSION['encounter']; $pid = $_SESSION['pid']; $date = date('Y/m/d h:i:s a'); $fr = $_POST['fr']; $fc = $_POST['fc']; $tas = $_POST['tas']; $tad = $_POST['tad']; $temp = $_POST['temp']; $gluc = $_POST['gluc']; $sat = $_POST['sat']; $pad = $_POST['padecimiento']; $ant = $_POST['antecedentes']; $exp = $_POST['exploracion']; $grupo = $_POST['grupo1']; $code = $_POST['code']; $diag = $_POST['diagnostico']; $man = $_POST['manejo']; $act = "1"; $table_name = "form_notaC"; if ($encounter == "") $encounter = date("Ymd"); mysql_query("INSERT INTO form_notaC (pid,date,provider,encounter,fr,fc,tas,tad,temp,gluc,sat,padecimiento,antecedentes,exploracion,code,grupo1,diagnostico,manejo,activity) VALUES ('$pid', '$date','$prov', '$enc',$fr','$fc','$tas','$tad','$temp','$gluc','$sat','$pad','$ant','$exp','$code','$grupo','$diag','$man','$act')"); $id =mysql_insert_id(); addForm($encounter, "Nota de Consulta", $id, "notaC", $pid, $userauthorized); formHeader("Redirecting...."); formJump(); ?>[/php]