technotool Posted July 19, 2008 Share Posted July 19, 2008 Below I have code which processes a form. I am trying to insert certain parts of the data into a MySQL database. The SQL insert statements are working but 2 pieces of data are not being inserted. "levels" and "procedure" take variables $procedure_levels and $procedure_totals which are formed by the concatination of other strings and variables. if I echo out $procedure_levels and $procedure_totals they echo out fine but they just wont go into the database. Thanks for your help. technotool -- -- Table structure for table `procedure_log` -- CREATE TABLE IF NOT EXISTS `procedure_log` ( `id` tinyint(11) NOT NULL auto_increment, `person_id` tinyint(11) NOT NULL, `levels` text NOT NULL, `procedure` text NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=6 ; <?php // //tfesi.php processing form //database osemrcom_dictation // session_start(); include ("../mylibrary/common.php"); db_connect(); // debug(); require ("../config/config.php"); //configuration file with POST[array] conversions $procedure1=$_POST['procedure1']; $procedure2=$_POST['procedure2']; $procedure3=$_POST['procedure3']; $proclevel_1=$_POST['proclevel_1']; $proclevel_2=$_POST['proclevel_2']; $proclevel_3=$_POST['proclevel_3']; $procedure_levels=$proclevel_1." ".$proclevel_2." ".$proclevel_3; $procedure_totals=$procedure1." ".$procedure2." ".$procedure3.; $output=<<<html_tag <head> <link rel="stylesheet" type="text/css" media="screen" href="../style/report.css" /> <link rel="stylesheet" type="text/css" media="print" href="../style/print.css" /> </head> <body> <div id="headertitle"> <p class="headertitle"> Lumbar Transforminal Epidural Steroid Injection under Fluoroscopic Guidance </p> </div> <div id="demographic"> <p class="demographic"> <b>Patient Name:</b> <b> $lastname, $firstname </b> <br> <b>Date:</b>  $date   <b> Record#:</b> <br> <b>Pre-Operative Diagnosis:</b> $preopdx   <b>Post-Op Diagnosis:</b>   $postopdx <br> <b>Procedure:</b>   $proclevel_1 $proclevel_2 $proclevel_3 $proclevel_4 $proclevel_5 $proclevel_6   Lumbar Interlaminar Epidural Steroid Injection with Epidurogram<br> <b>Injectate:</b> $mgsteroid $steroid   $ccanes $anest <br> <b>Contrast:</b> $contrast <br> <b>Anesthesia:</b>   Local with 1% Lidocaine<br> <p> </div> <div id="indications"> <p class="title">indications:</p> <p class="content"> After reviewing the clinical history, physical exam, and appropriate imaging studies, the following procedures were deemed to be of further diagnostic and therapeutic benefit.<br> </p> </div> <div id="procedure"> <p class="title">procedure:</p> <p class="content"> The patient presented to the minor procedure suite for therapeutic epidural steroid injection under fluoroscopic guidance. The benefits and risks and potential complications of the procedure were explained to the patient, and all questions were answered. The written consent form was signed by the patient and witnessed. </p> <p class="content"> The patient assumed a prone position on the fluoroscopy table. Physiologic monitors were applied, and vital signs were recorded in the nursing record. Fluoroscopic visualization was used to identify the lumbosacral anatomy. The skin was sterilized with three applications of betadine (or cholorhexidine if there was an iodine allergy) and sterile drapes were applied. The skin was anesthetized with 1% lidocaine via a 27-gauge 1.5 inch needle. Next, A $needlesize was then advanced towards the superolateral aspect of the $side   $proclevel_1 $proclevel_2 $proclevel_3 $proclevel_4 $proclevel_5 $proclevel_6 neuroforamen with the aide of AP and Lateral fluoroscopic projections to ensure proper needle position. Next, after negative aspiration of CSF or blood, 1-2 cubic centimeters of contrast dye was instilled under live anterior-posterior fluoroscopy, which identified dye spread along the nerve and into the epidural space. Results of the epidurogram are described below. Next, a steroid solution (described above) was divided equally and injected into each neuroforaminal space mentioned above. Washout was visualized on the fluoroscope. </p> <p class="content"> Following steroid administration,the needle was then withdrawn slowly and carefully. Hemostasis was established and sterile dressings were applied. The patient tolerated the procedure well, and was discharged to the recovery room in stable condition. </p> </div> <div id="findings"> <p class="title">findings:</p> <p class="content"> Epidurogram was normal and showed good outline of the exiting nerve root(s). Contrast dye could be seen extending superior and medial to the pedicle at the above mentioned level(s). Under live fluoroscopy, there was no intravascular uptake and dye flow was extradural. The patient tolerated the procedure well and was discharged ambulatory in stable condition.   $addfind </p> </div> <div id="followup"> <p class="title">follow-up: $fu</p> </div> <div id="closing"> <br> <p class="closing"> ____________________________________<br> <br> Attending Interventional Physiatrist<br> Board Certified Physical Medicine and Rehabilitation/Pain </p> </div> </body> html_tag; //echo $output; if ($_POST['formshow']=='noshow') { $procedure1=$_POST['procedure1']; $procedure2=$_POST['procedure2']; $procedure3=$_POST['procedure3']; $proclevel_1=$_POST['proclevel_1']; $proclevel_2=$_POST['proclevel_2']; $proclevel_3=$_POST['proclevel_3']; $procedure_levels=$proclevel_1." ".$proclevel_2." ".$proclevel_3; $procedure_totals=$procedure1." ".$procedure2." ".$procedure3.; $final_report=$_POST['final_report']; $userid=$_SESSION['userid']; $person_id=$_SESSION['person_id']; echo $final_report; $sql1="INSERT INTO procedure_log (`id`,`person_id`,`levels`,`procedure`) VALUES ('NULL','$person_id','$procedure_levels','$procedure_totals')"; $result=mysql_query($sql1) or die ('Unable to add dictation1'); if ($result) echo "recorded1"; else "not recorded1"; $sql="INSERT INTO transcription ( `id`,`person_id`,`dictation`,`created`,`user`) VALUES ('NULL','$person_id','$final_report',CURRENT_TIMESTAMP,'$userid')"; $result=mysql_query($sql) or die ('Unable to add dictation'); if ($result) echo "recorded"; else "not recorded"; }else { echo "<form action=\"$PHPSELF\" METHOD=\"POST\">"; echo "<textarea name=\"final_report\" rows=\"30\" cols=\"100\">$output</textarea>"; echo "<input type=\"submit\" name=\"submitvalue\" VALUE=\"finalize\">"; echo "<input type=\"hidden\" name=\"formshow\" value=\"noshow\">"; echo "</form>"; } ?> Quote Link to comment Share on other sites More sharing options...
budimir Posted July 19, 2008 Share Posted July 19, 2008 Try putting on your query ... or die (mysql_error()); So, you will see what exactly is bothering you. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.