This insert works ok, but code2 varchar(20) seems to get stored with an extra couple of spaces in front of it.
$tbl_query="INSERT INTO mytable (code1, date1, time, code2 )
values
('".$_POST['code1'] ."','
".$Date1 ."','
".$_POST['time'] ."','
".trim($_SESSION['code2'])."')" ;
echo "<br>CODE2: ".$_SESSION['code2']."<br>" ;
echo disp_stored($Date1) ;
The echo of code2 and the echo of the $tbl_query looks ok on screen. My disp_stored()function does not return results since it's asking for code2='abc' but code2 just got stored as ' abc'. I can see this when looking at the data through mysql at the console.
Thanks - Keith
$tbl_query="INSERT INTO mytable (code1, date1, time, code2 )
values
('".$_POST['code1'] ."','
".$Date1 ."','
".$_POST['time'] ."','
".trim($_SESSION['code2'])."')" ;
echo "<br>CODE2: ".$_SESSION['code2']."<br>" ;
echo disp_stored($Date1) ;
The echo of code2 and the echo of the $tbl_query looks ok on screen. My disp_stored()function does not return results since it's asking for code2='abc' but code2 just got stored as ' abc'. I can see this when looking at the data through mysql at the console.
Thanks - Keith