Does $wpdb work outside of the template page file? (1 post)

  1. surfacinglove
    Posted 4 years ago #

    I am trying to set up where when a user clicks on a button, they will create a new row in a table in the database without refreshing the page using jQuery and AJAX. I am using the following as an example:


    My main question is this: How can I still use $wpdb format in my "external" .php file that is called by AJAX (stored in the same location as the custom page template that calls it). Do I have to include or require something? Everything works except the updating of the database. Any help would be great please!

Topic Closed

This topic has been closed to new replies.

About this Topic