The contents can be inserted by using the function given below: function my_plugin_insert_db() { global $wpdb; $username = ‘wordpress’; $email = ‘test1@wordpress.com‘; $table_name = $wpdb->prefix . ‘db_plugin’; $wpdb->insert( $table_name, array( ‘username’ => $username, ’email’ => $email, ) ); } if(isset($_POST[‘button2’])) { global $wpdb; $username = $_POST[“fname”]; $email = $_POST[“email”]; $table_name =… Continue reading Insert Contents into the table of database
Author: Akhil Johny
Creating a table in the database of WordPress.
Create a table in the database of WordPress. A PHP function is used to create a table in the database. While working on WordPress one of the most important thing to know is about how to create a table and how to insert data into the table. The PHP function to create a table in… Continue reading Creating a table in the database of WordPress.