I'm looking for some help on how to start looking for tutorials examples of something (terrible sentence).
Basically I have a page that does an mysql query for
fname lname date score cname result
and draws each row in the table with a while loop
e.g.
joe smith apr 25 95 john sale
This page works just fine.
What I want to do is click on a button and have a form show under each row in the table so I can do another query to submit new data for that row.
so say I wanted to update joe smith's score I would click on a button beside his row (at the end) and this would drop down a form with all the fields and a submit button so I could then do a query on submit to alter whatever data.
The problem is I have no idea where to even start looking for help on this. Any examples that are sort of like I describe would be hugely helpful and if any of the above is unclear (very likely) I'll try and clarify as best I can.
Posts
Also I got it to show the form when you click a radio button and hide it when you click another one.
Now the last challenge is to find out WHICH table row I have clicked the radio button for and take a piece of data from there (reps name) so when I have the form submit it updates the correct person.
I know it's not formatted very well.
So when I click button 1 I need to be able to get data for the row it's in, specifically the rep field.
EDIT: I used jquery and css (tutorial)
I got it to show the rep name in the form (pulled from $rep) but it only does this for the first rep name. I would guess because it only creates the form the first time through and not for each row of the table.
to clarify, if I had
joe
john
jacob
josh
I'd like a radio button at the end of each row to show or hide a form (check)
I'd like the Rep field in the form to be populated with the rep name on that line
Here is the complete code sans mysql db info
Becomes:
I could be wrong about the details of escaping quotes. I don't do a lot of PHP. But this is the basic idea: instead of creating just one form, you're creating one form for each row of the table. The form for rep "joe" would have the id "form-joe" and it's associated radio buttons will call $('form-joe').show()/hide().
This assumes that 'rep_name' is the key of your table. If it's not, you'll have some issues.