Updating database with ajax

What I need is for this variable to be dynamic, that is to say, that the variable name changes per field.I 'could' just assign a var for each variable in the script, but problem a: there are 6 different tables involved in this update and problem b: there are almost 50 fields to work with and they may change from time to time; I don't what to have to do extra work if I don't have to.

So here is an example form Now whenever a user changes a value on any one of the fields, the field is updated in the DB and a confirmation is printed below the field saying "Data Updated" or something to that effect.

Now using ajax I've been able to update a single field.

But the script I'm using assigns the updated value to the same variable every time (in this case it's 'q').

the javascript looks like this (I found this on the web all over the place) I see why the variable 'q' ends up being what is passed to the db update script.

To allow automatic updates you need to set the Allow Automatic Updates="True" and Auto Post Back On[Operation]="True" property of the listbox.

The listbox must be bound to a declarative Data Source which has its Update Command and/or Delete Command configured.We have used a j Query handler which generates and sends AJAX call to the backend database along with the action requested. If you are looking for a non-AJAX plain PHP CRUD, go through my previous tutorial.View Demo We have form controls to enter user data and trigger AJAX event to perform database action.Here we have use Ajax Jquery and by jquery we have get employee id from edit button, we have create all employee separate edit button with different id and in this id we have store employee id and by using jquery code we have get employee id from button and by using ajax we have fetch that employee id data from database and then after we have display that data into Bootstrap Modal html form field and in html form we can change data and by clicking on update button we can update data into mysql database by using Ajax request method.In this j Query AJAX tutorial, we will learn about how to add, edit and delete records in My SQL database using PHP.I suppose I'll also have to send the old value (or the id for the row of that table being updated) so it may need to be something like "table|row|fieldname" If I can get assistance with the first part (dynamic variable name), I can figure out the second half pretty easily.

Tags: , ,