I've been working on a project that runs off another programs API that now dumps its data into a MySQL database. The project is pretty much GUI / admin portal to manipulate the data and then save it once finished. The issue I'm running into is that I can't seem to figure a way to associate the row that I want to save.
Below is a snapshot of what I have setup right now. I can't figure out a way to tell the PHP script which user data to save/update.
Thanks in advance.
http://grabilla.com/0920d-16ce371e-9793-4105-9d49-5deafb187058.png
Yes all the values are being pulled from the database and populating the table with that information. I've thought of a few hacky ideas like that but they all seem like they'd be inefficient..
Just make it so the save button adds sends a request back to the server with the ID of the employee and their new status.
You can do this in a number of ways, such as a generic web form, or over javascript.
You're printing the data's key value to the interface, there should be nothing stopping you from using it to send data back into the backend. You just need a script on the server to process the request
Put a hidden input field with the form that submits the save.
Psuedo-code:
<form action="your_save_script.php">
<input type="hidden" name="row_id" value="<?php echo $row->id; ?>"/>
<submit value="Save">
</form>
Then with some javascript you could put the configuration you wish to save as another hidden field in the form.
Alternatively you could wrap your entire table row in the form and have the actual dropdown be part of the form. Though I would refrain from this as it mangles your HTML and is not semantically correct.
Sorry, you need to Log In to post a reply to this thread.