Adding specific rows in the table

this POST could have been posted in the database forum,nonetheless PHP code might be the solution here…

In my app/site business users are called to enter their services that they offer.Imagine now the scenario that the user has already entered one service(for example,on registration) and he/she comes to add another one(or more).The form will be something like this to get an understanding:fiddle

Just click the the black diagonal line.
And the question is how am I going to send to the database only the newly added service(everything is done with ajax)
Here is the HTML of the already stored row in the db.

<input class="services text" data-service="11" size="40" value="hair" type="text" name="service0">

the data-service number above is the ID stored in the db…just in case this info might help.
Any ideas?

Any newly added service does not have a service number, right?

On MySQL level I’d solve that by INSERT ... ON DUPLICATE KEY UPDATE ... in case an existing service was modified.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.