![]() |
|
#1
|
|||
|
|||
Add a tool to a yet written code-help would be great!Hi,
I' ve the following problem: Out of several pieces of code(not mine), I've made a library. Now it works, but I want to add another feature and don't kno how to do. The following:If PHP has found a book in my mysql database, it reports me the results listed one book after the other. Now I want a checkbox below every result->(book). If you want to borough this book from the schoollibrary,you just mark it. At the end of the page should be a rollout with the pupils' names, where you can choose your name. Then the submitbutton should deliver the IDs of the before marked books and register the bookID-userid combination into the user tablelooking like this: relation_user_book : table user, userID,int,not null bookID(in my table titleId),int,not null, user table: userid, name, prename, Here is the code of the "show results ",It's long but perhaps you can handle withit, because in the german forums they werentable to help me. PHP Code:
Matthias |
|||
|
#2
|
||||
|
||||
|
The ids of the 'marked' books should be passed along in a session?
When the user id is 'checking out' just pass the values off the session to the table relation_user_book. I am sorry, I ignored your code - I have been coding for a bit these past few days and I have had about enough of PHP code for now... __________________
J de Silva Learning Journal | GIDForums™ | GIDNetwork™ | GIDWebhosts™ | GIDSearch™ |
|
#3
|
|||
|
|||
|
When you loop through the db, having it spit out the books and their information, have the loop echo an input box with the name of "checkout[]" ([]makes it an array), and give it the value corresponding to the book's id.
Code:
That should create an array called "checkout" of all the books "checked", which will contain all the ids of the books to be loaned out. I'm still a newbie with arrays so I could be wrong, so feel free anyone to correct me if I am. |
Recent GIDBlog
Once again, no time for hobbies by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Save code option | BobbyDouglas | GIDForums™ | 3 | 09-Nov-2003 00:48 |
| something wrong with this code | loon | MySQL / PHP Forum | 5 | 07-Jul-2003 06:55 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The