In your code, if an email is set and validated (which I suppose should be the normal case), your code will exit at wp_die(), and never reaches the $wpdb->insert.
Your $wpdb->insert statement will only ever be reached if an email is not set, or if “validation” is false.
You might want to get rid of the wp_die() call altogether, or place that call at the very end of your function, depending on your needs.
Other than that, try determining whether your function is called at all (might be something wrong with the AJAX call itself).
Related Posts:
- Trying to establish connection to External Database
- How to return number of found rows from SELECT query
- $wpdb->delete column values IN ARRAY()?
- WPDB: how to get the value of a field in a custom database table
- Prevent Data Resubmission On Page refresh
- Any possible way to make $wpdb->get_results() return anything else than array?
- database interactions using OOP
- Display fields as values in array from external SQL DB
- Getting id of poll from WP database
- WSoD being caused by this piece of code
- $wpdb->update with multiple parameters gives error
- Update results, Before deleting the related category [closed]
- How WordPress reacts to a lack of memory of the server [closed]
- Display Data in Table from External Database in WP using Shortcodes
- How to retrieve the data from the sever and displaying it in a page?
- I can’t update my data through $wpdb
- wpdb Cannot Update column in Database
- How to use mysql LIKE with wpdb?
- Delete database record using plugin from admin panel
- Wpdb get->results to out the the month from the db
- How to add data to a custom field at the wp_users table?
- Change MySQL PDO connection to a WPDB connection
- WPDB – Read and write value from / to database
- How to Generate a list of Most Commented post?
- Add row to custom database Table and delete all rows older than 1 day
- select a single val though a table in wordpress
- SQL error with custom query
- Add posts to custom table in database instead of wp_posts
- Isn’t Returning Value While Using SELECT COUNT(*) FROM {$wpdb->prefix}
- Database entry removed on browser refresh, Ajax PHP jQuery
- Change wordpress’ database data using ajax – how to get current user id?
- Create a new account on site B with data from the purchase of site A
- Using wpdb to connect to a different database is not working
- Modify post image in full size
- How to grab data from input and store it into custom table in database?
- Accessing external database: ERR_INCOMPLETE_CHUNKED_ENCODING
- Weird Behaviour: Not all WordPress Posts appearing
- How to fetch results from database
- Check if values exists DB
- Querying multiple meta_keys in WordPress SQL query
- MySQL database migration to WordPress
- Fetching wpdb data from a php file seems to break?
- Insert into db with foreach problem
- posts_clauses drop ACF get_field function
- How to get data (not value or name) from radio options to POST to database
- Putting form result in my database
- start_lvl Ignored in Custom walker_nav_menu
- wpdb::prepare was called incorrectly
- How do I make my function add variables/values to the $post object?
- Calculate percentage of post by category
- Change comments form title on a page by page basis
- Get the title before comma
- How do I know what variables are passed in a filter/action and what their meaning is?
- “Can’t use function return value in write context” error
- Display 4 chronological posts starting with a random post
- PHP syntax error when using wpdb update?
- Wrap each shortcode in array to div
- Warning: array_pop() expects parameter 1 to be array, boolean given
- How to migrate the posts from an old custom legacy blog to a new WordPress website?
- get_the_terms – only top level
- Run a filter when a walker runs
- Swapping wp_dropdown_categories function with wp_category_checklist
- How to display posts by current user in a drop down
- How to change menu order item
- responsive.css in the WordPress should be prioritized
- How to display login form anywhere, when user isn’t logged in, without redirecting?
- Widget back end radio button issue
- Execute a function every hour in the background
- Create page with custom php script and fetched data
- GET problem in WordPress
- Send a mail to specific address in a custom field when a new comment is made on a specific post
- CSS change in woo commerce Place Order Text [closed]
- WP All Import / Update stock quantity from multiple XML files
- Hide a div when a custom field is empty
- Call to a member function get_row() on a non-object, Unable to use global $wbdp inside a plugin
- Can’t log in to WordPress wp-admin after adding code to functions.php
- How to change basename url for wp-admin?
- How to exclude meta no index pages from wp_list_pages
- Products listing check if meta checkbox is checked
- Hide a div if the fiels is empty
- Illegal string offset checkbox
- require get_template_directory() . ‘path/to-my/file.php’ BREAKS customize > themes functionality
- Get Shortcode output to database for static post_content
- Edit a function to take different actions based on user role
- I got big white screen when i attach main style sheet of Html in functions.php
- Using Javascript On Page – Header and Footer Now Missing
- Unzip_file causing Media file upload error
- wp-login.php?redirect_to=https problem
- Escaping a Single Quote in str_replace for Nav Function
- Private messaging – Getting and displaying the avatar/url of a message recipient
- insert thumbnail image from php script
- WordPress rating by views [closed]
- Problems with plugin that fetches data from database with ajax
- Trying to see if page is category or single and displaying title with appropriate heading tag
- Get null from POST
- WordPress causing all code to be displayed on line 1. Receiving multiple errors after cleaning cookies and cache
- Remove default Image Sizes
- A better way to write this php function
- a problem in class in class-wp-hook.php
- change title of page dynamically