dolcezza Posted January 15, 2008 Share Posted January 15, 2008 I have a form, when the user clicks "submit" it inserts into a database AND sends the info through a pdf. The new info in the form is not being included in the pdf. It is inserted in the database though and if you go back and do it over, it shoes up on the pdf. The other variables are working fineCould this be a commit issue? If so, how do you handle something like this? $schedulequery = ("SELECT * FROM `schedule` WHERE eventid = '$eventid'"); $scheduleresult=mysql_query($schedulequery); for ($i = 1; $i <= 3; $i++) { $time = $_POST['time-' . $i]; $grades = $_POST['grades-' . $i]; $room = $_POST['room-' . $i]; $notes = $_POST['notes-' . $i]; if ($time) { $scheduleinsert = "INSERT INTO schedules (eventid, time, grades, room, notes) VALUES ('$eventid', '$time', '$grades', '$room', '$notes')"; $schedule_result=mysql_query($scheduleinsert); } } other code in between... $pdf->Cell(10,10, 'Schedule:' ,0,1); $schedule_query="SELECT * from schedules where eventid=$eventid ORDER BY time"; $schedule_result=mysql_query($schedule_query); for ($i=1;$i<mysql_num_rows($schedule_result);$i++) { $schedule_info=mysql_fetch_array($schedule_result); $schedule=$schedule_info['time'] . $schedule_info['grades'] . $schedule_info['room'] . $schedule_info['notes']; $pdf->Cell(10,10, $schedule ,0,1); } $pdf->Cell(10,10, 'Contact:' ,0,1); $pdf->Cell(10,10, $name ,0,1); $pdf->Cell(10,10, $email ,0,1); $pdf->Cell(10,10, $phone ,0,1); $pdf->Output(); Quote Link to comment https://forums.phpfreaks.com/topic/86067-query-after-a-form-insert-is-it-a-commit-problem/ 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.