Skip to content
Advertisement

Update database with a live choice made by client

How to update a specific cell in phpmyadmin with jQuery after appending a specific div to a group, code is below

JavaScript

the problem is when the item getting updated in database, it became always Group 2 which is the second update. So how to update the database with the selected group on a side question is it better to use dropdown list or buttons in selecting groups

Advertisement

Answer

You need to create a <form> element that uses the POST method to a php script.

JavaScript

In your php script you would use $_POST['my_option'] to get a form option by its name… you can execute your sql in the php file.

Since you tagged jquery, you could also use the jquery onsubmit event with $.ajax: (documentation)

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement