Thomas2 Posted March 25, 2008 Share Posted March 25, 2008 hello, basically ive got a while loop which brings up bookings dates but i want to send a selected row to a table in the sql table but depending on one specific field for instance if the name = tom i want to sent it to the tom table, i have three tables and three names. I have got checkboxes so a user can select up2 2checkboxes once they click send it should send data to database im finding this task very difficult so if anybody could help i would be very grateful. Here is my code; // Loop through data and display while($a_row = mysql_fetch_assoc($result)) echo "<tr>". '<td style="color: black;"><input type="checkbox" name="bookings[]" value="'.$a_row['id'].'"></td>'. "<td style=\"color:Black\">".$a_row['Bookingdate']."</td>". "<td style=\"color:Black\">".$a_row['DayofWeek']."</td>". "<td style=\"color:Black\">".$a_row['TimeOfDay']."</td>". "<td style=\"color:Black\">".$a_row['TimeOfDayEnd']."</td>". "<td style=\"color:Black\">".$a_row['LessonType']."</td>". "<td style=\"color:Black\">".$a_row['Gearbox']."</td>". "<td style=\"color:Black\">".$a_row['InstructorName']."</td>". "<td style=\"color:Black\">".$a_row['CostForLesson']."</td></tr>"; // Close connection ! (please !) mysql_close($connection); ?> its all working results show but nothing happens when you click on checkboxes i have used id as unquie and i have id in the database table. If any1 cud help Link to comment https://forums.phpfreaks.com/topic/97835-send-data-from-while-loop-to-mysql-database/ Share on other sites More sharing options...
trq Posted March 25, 2008 Share Posted March 25, 2008 Are the checkboxes actually within a form? Link to comment https://forums.phpfreaks.com/topic/97835-send-data-from-while-loop-to-mysql-database/#findComment-500539 Share on other sites More sharing options...
Thomas2 Posted March 25, 2008 Author Share Posted March 25, 2008 Are the checkboxes actually within a form? no they are in the loop, is where the data is returned from the database Link to comment https://forums.phpfreaks.com/topic/97835-send-data-from-while-loop-to-mysql-database/#findComment-500549 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.