hi all. im currently a student doing a project for my course. ive got to the stage where im very stuck.
im working in PHP with MYSQL database
ive got lots of tables but for this the important ones are items and bookings
items = list of items a customer can book (ITEMS table with a itemID as p key) (and other things)
bookings that got a booking id and a “selecteditems” field which has items in it. (booking id prim key) (and other things)
heres what i want to do…
1… make a booking
booking.php page a loop to show all the possible items.
A check box for each of the items in the items table in mysql
The value of the check box should be the itemID
And for each of the items a customer decides to have s/he will tick all those boxes
ie list all of the items how ever many there are in the table…
1 2 3 4 5 6
2. store the booking as a string
The value from all the ticked boxes (ie itemID) i want to turn in to a string using implode to have comma between them so i can store the string in in the bookings table as selecteditems … ie if the user ticks 1 3 5 it would store string in booking table selecteditems field as 1,3,5
the last part of what i want to do is read from the bookings table to view or edit…
3… on a viewbookings page it will look at the bookings table and look at the item table and display on the page all of the items in the items table as check boxes again similar to what it did in the first place to make a booking…
but this time it should tick the check boxes if it was ticked in the first instance on the bookings page… just so customer can view what they booked
ie list all of the items
1 2 3 4 5 6
show the ones that were booked
[/]1 2 [/]3 4 [/]5 6
ive got to the point where i can to the first 2 but don’t know about number 3. i don’t think the way i am doing the first 2 is any good either,
if there’s anyone who knows the theory behind what im trying to do please help.
there’s more to it then just what ive put on, just but im just trying to get the basics working first.