After dynamically creating a client-side table based on SELECT information retrieved from MySql database, how can I select a row from the client-side table and return that row(s) information back into PHP so that I can process it into a MySql query to return other specific information?
What I’m trying to achieve: I’m creating a (relatively) simple administrative CMS (not using any .htaccess, purely server-side scripting). On the admin page I will have various tables populate based on the information I request; let’s use the Website User information for this example. After populating the client-side table with a checkbox for each row and other minor information (username, first/last name etc), I want to be able to check the checkbox next to a specific name, select an action (i.e. view users profile, ban, etc) from a dropdown box and ‘Submit’ the request.
Question: How do I now take that single (or possibly multiple) row that I checked and return it (identify it) to php so that I can run a MySql query on that specific row(s) only, after the action has been submitted? Usernames are unique in my sql table, so using that as the identifier for the return information/value for processing would be best. Keep in mind that the positioning of data within that table could change with each page load, depending on new users and other situations (in other words, row 1 of the client-side table may not always be ‘Jim Jones’ when the table is populated.) I’m not opposed to any solutions that may incorporate javascript/jquery if that is the best solution to this problem.
Thanks for your help everyone!
You are mixing matters. And running too fast, trying to solve a thousand tasks with one solution.
Pressing several buttons to view user’s profile makes no sense.
It have to be a hyperlink.
where
20is an auto incremented unique identifier (not name obviously)For the group actions you have to use arrays
And POST method for data modifications
so, here is an example HTML
where 20 and 55 are ids again
PHP