Insert user register into my own user table instead of wp own user

I figured it out myself I needed $wpdb and a , after the db_name Here is the result. $user_id = $wpdb->INSERT( ‘wp_fisker’, array ( ‘fisker_fornavn’ => apply_filters(‘pre_user_first_name’, $fisker_fornavn), ‘fisker_efternavn’ => apply_filters(‘pre_user_last_name’, $fisker_efternavn), ‘password’ => apply_filters(‘pre_user_user_pass’, $password), ‘telefon’ => apply_filters(‘pre_user_telefon’, $telefon), ‘zip’ => apply_filters(‘pre_user_zip’, $zip), ‘by_navn’ => apply_filters(‘pre_user_by_navn’, $by_navn), ’email’ => apply_filters(‘pre_user_user_email’, $email) ) ); if( … Read more

How can I get $wpdb to show MySQL warnings?

From quick look through the source it doesn’t seem like wpdb actively implements any handling for warnings (as opposed to errors). Proactively you can just ask for them as a custom query ($wpdb->get_results( ‘SHOW WARNINGS;’ ) I suppose, but implicitly they just aren’t tracked by WP core.

implementing my wp_query using $wpdb class

You haven’t mentioned what you want from this request and what is it for. You should clarify that to get the most accurate answer. Anyway, if you want to write a pure SQL request you can’t use WP_Query but need to use $wpdb->get_results instead, as mentionned by @hadimahoor. Here is a request to get a … Read more

Unable to use $wpdb in WordPress

You should use the default way the WP recommend to handle ajax calls. This will save you from lots of pitfalls and bad practices. add_action( ‘wp_ajax_nopriv_****’, ‘your_custom_function’ ); add_action( ‘wp_ajax_****’, ‘your_custom_function’ ); function your_custom_function() { } JS part jQuery.ajax({ type: “post”, dataType: “json”, url: ajax_url,// need the admin_url(‘admin-ajax.php’) data: formData, // your data success: function(msg){ … Read more

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