HTML Form Submit to table in same page

Couple of things with this. Your action attribute is empty. That’s the attribute that tells the browser where to send the posted form data. Should be a field or if you’re using AJAX, I always put # in there and let the javascript do it’s thing. Not sure about the cf_name attribute in your input … Read more

Gravity Forms – gform_field_value – query custom table breaks functions.php

Add this line, before using $wpdb: global $wpdb; In the line: $item_info = $wpdb->get_row(“SELECT * FROM fm_household WHERE k_RecordNum=’$id'”); in WHERE clause, k_RecordNum is being compared to ‘$id’ string, not to the string value of $id parameter. Change this line to: $item_info = $wpdb->get_row(“SELECT * FROM fm_household WHERE k_RecordNum='{$id}'”); It is very important to check, … Read more

Looking for a simple tool to update a table

WordPress has an API available to allow external scripts to get data from your website and to add (POST) data to your website. You can create a custom API endpoint where you receive the data from the other server and in a simple function create a new record in the WordPress database: Create a function … Read more

Querying specific table row by current user login

Welcome! WordPress already have a table for users. Also, there is another table named usermeta that will allow you to save extra information for users. There are some functions that allow developers to get information from user and usermeta tables without using custom database queries. add_user_meta update_user_meta delete_user_meta get_user_meta Solution: As mentioned in the question, … Read more

How to make wordpress use a non-wordpress users table?

I figured it out. All I did was create a VIEW mapping the columns like this: CREATE VIEW wp_users (ID, user_login, user_pass, user_nicename, user_email, user_url, user_registered, user_activation_key, user_status, display_name) AS SELECT u.user_id, u.username, u.password, u.first_name, u.email, ”, u.date_created, ”, 0, u.display_name FROM Users u;

Saving contact form 7 data into custom Table

CF7 has an useful hook wpcf7_submit that can be used to process the data sent: add_action(“wpcf7_submit”, “SE_379325_forward_cf7”, 10, 2); function SE_379325_forward_cf7($form, $result) { if( !class_exists(‘WPCF7_Submission’) ) return; $submission = WPCF7_Submission::get_instance(); if ($result[“status”] == “mail_sent”) { // proceed only if email has been sent $posted_data = $submission->get_posted_data(); save_posted_data($posted_data); } }; // your insert function: function save_posted_data($posted_data){ … Read more

Register custom table for WP to use in a plugin

That’s not what the $tables variable does, and there is no such thing as a registered custom table. These variables are an internal API not intended for plugin/theme developer use. The $wpdb->mytable pattern itself is just something someone did because they wanted to avoid prefixing manually that caught on in early WordPress articles. The reason … Read more

Best tools for preparing and styling a table [closed]

WP-Table Reloaded is a great plugin which allows you to create tables and use their shortcodes in your post. Bear in mind, however, that not all themes are “table-friendly”. Alternatively, you can try Dean’s FCKeditor Plugin For WordPress, which appears to have an “Insert Table” function to keep you from messing around with HTML. And … Read more

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