Surrogate ID for posts, is there an alternative field in the posts table?

It depends on how are you importing those posts. You can use wp_insert_post() with import_id: $postToBeInserted = array( ‘post_title’ => ‘Your Post Title’, ‘post_content’ => ‘Your post content…’, ‘import_id’ => 154 ); wp_insert_post($postToBeInserted); If there is no post with the specified import_id the post will have that ID. That way you won’t have to deal … Read more

I have include wp-config, should I add global $wpdb also?

If you need a processing endpoint with access to the WordPress API, use the admin_post_ action and eliminate the need to manually include wp-config.php or any other WordPress files. // add for logged-in visitors add_action( ‘admin_post_your_action’, ‘prefix_your_action_function’ ); // for non logged-in visitors add_action( ‘admin_post_nopriv_your_action’, ‘prefix_your_action_function’ ); function prefix_your_action_function() { global $wpdb; // your processing … Read more

Create Tables in WordPress

Since you are a first timer (Welcome to the WordPress World, by the way) an easy way to achieve that is using plugins. For forms, I recommend Contact Form 7 (https://wordpress.org/plugins/contact-form-7/). It will allows you to create almost any type of form. To record the data into database and display as table, you can use … Read more