Help posting values to DB on submit using $wpdb->query

$wpdb has an insert method, so you can try the following: $table=”wp_email_subscribers”; $data = array( ‘first_name’ => $firstname, ‘last_name’ => $lastname, ’email’=> $email , ‘gdpr_consent’=>$gdprconsent ); $format = array(‘%s’,’%s’, ‘%s’, ‘%s’); $wpdb->insert($table,$data,$format); var_dump($wpdb->insert_id);

I am trying to add checkbox for anonymous post on form post

First of all don’t ever edit core files. Your changes will be lost on update. WordPress has a great way to expand as needed called Plugin. As you don’t have enough knowledge about how WordPress works I suggest to use this ready made solution to avoid any risk. Here is the link

Reading POST over admin-ajax.php

OK, so there are many problems with your code… But I’m pretty sure I know, where the major one lies… But first things first… You add your AJAX callbacks with this code: add_action( ‘wp_ajax_wilcity_handle_review_listing’, ‘address_save_postdata’ ); add_action( ‘wp_ajax_wilcity_handle_review_listing’, ‘address_save_postdata’ ); It doesn’t make sense to add the same function twice. It can be a mistake, … Read more

Registration form AJAX check for existing username (simple version)

You’re POSTing user_name but in your code you’re checking for register_name, you should instead check $_POST[‘user_name’] instead. You should also be checking to make sure a value is actually being passed as well, this is how I would do it instead (setting unavailable as default): function mpl_check_username() { $response = array( ‘status’ => ‘unavailable’, ‘text’ … Read more

display a message if get form is empty

If anyone faces the same problem, its easy to display a message with have_posts() <?php if ( have_posts() ) { echo “Events gefunden”; } else { echo “Keine Events gefunden”; } ?>

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)