Jump to content

send data from while loop to mysql database


Thomas2

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.