Access/update database with jQuery

Goal: Update wpdb each time a user clicks on a specific button.

Every time a user clicks on a button, I need jQuery to run a function that will update my wordpress database. As far as I understand, this must be done through an AJAX request sent to a php file residing on the server. This article seems to address my issue, but I am having trouble interpreting exactly what it is I need to do.

A couple of my questions are as follows:

  1. I will need a php file that will be called from the jQuery function, but where should that file be housed? I believe it should be at, but how can I get the file to be housed at that location?
  2. What exactly should this php file consist of?

If someone is able to give me the steps needed to accomplish this goal, I would be forever grateful. Thanks!

Read more here: Access/update database with jQuery

Leave a Reply

Your email address will not be published. Required fields are marked *