WordPress doesn’t work this way. If you want to work with a framework like WordPress, you should obey its rules!
Of course you can add a database record like this, but it is a really bad approach. Try some plugins for creating and saving forms in WordPress like Ninja Forms or Quform. You can even do it yourself, but its not recommended for WordPress newbies.
Related Posts:
- How to create and work with custom data / tables (i.e., for arbitrary data)?
- Insert data from form to database
- How to pass username into form that sends data to database
- Custom form that stores data in mysql database
- Putting form result in my database
- Can’t insert into a database wordpress
- How to return number of found rows from SELECT query
- How to correctly submit a search form and display the result in an independent page
- Check if post of title already exists
- $wpdb->delete column values IN ARRAY()?
- How To Make Connection To WordPress Data Base In A Plugin?
- Has anyone tried putting PHP ActiveRecord on WordPress?
- Changing user_nicename
- Does WordPress cache get_user_meta() results?
- WordPress will not operate correctly
- How to Join two tables from separate databases within WordPress
- error importing localhost export file to server
- Would manually deleting the dumping data fix a “#1062 – Duplicate entry ‘1’ for key ‘PRIMARY'” phpMyAdmin error?
- How to sort results from a custom database table
- How can I call a row of user specific data from a custom table added to the WP Database
- How to merge local and live databases?
- How to track a users progress through pages by inserting data into WordPress Database?
- Import 10,000 Users into WordPress WITH a specific ID for each user
- WP database error for comments_popup_link()
- if statement on database query
- Unusable menus and “Illegal widget setting ID: nav_menu_item[]” error
- No wp-config.php file on local install of wordpress – site still displays
- How to migrate the posts from an old custom legacy blog to a new WordPress website?
- Different database query in function.php using mysqli
- Adding Custom Forms
- Create WP_Query to search for posts by their categories or their parent/child categories
- WordPress not reflecting changed of the database
- How can I save unique user data on my site? [closed]
- Update results, Before deleting the related category [closed]
- database sent to a JSON file
- inserting a post from an extern php file but post content doesn’t show on wp site
- Using custom tables for old posts
- Databases – Submitting data from inputs to database [closed]
- db converts decimal number wrong
- Not connecting to database in file with multiple MySQL connections
- WordPress Block developer from exporting Database via PHP
- wpdb prepare insert table doesn’t work
- Should I use WordPress to skin a database website?
- How do I display offsite database info on my wordpress site?
- Creating Database Table vs. Adding MetaData to Post & User
- WordPress and MySQL: trying to print data using PHP from user_meta custom field data
- Most commented posts by time period (last 12h, last 24h and etc)
- I can’t update my data through $wpdb
- Submitting a form, using Ajax, to run a SQL Select query based on user input from the form
- Get wp_current_user_id using PHP and MySQL
- form $_post action value gets truncated after it passes through two forms
- WPDB secure custom form
- Why when I create a new post I found 2 record related to this post into the posts database table?
- phpMyAdmin error #1062 – Duplicate entry ‘1’ for key ‘PRIMARY’
- Add row to custom database Table and delete all rows older than 1 day
- select a single val though a table in wordpress
- SQL error with custom query
- Using Ajax to submit a form, and run a SQL Select query based on user input from the form
- What’s wrong in my PHP code? I’m using WordPress Astra Theme and I can’t insert data into my SQL
- Please help! I have a problem with getting wordpress databas
- Error establishing a database connection (Set-up locally)
- $_POST returning empty values
- How to send custom form submissions to WordPress Database?
- PHP Warning: mysqli_query(): after updating my websites php from 5.6 to 7.2
- Confuse between forms and tables
- Using wpdb to connect to a different database is not working
- Updating the database after parsing CSV document
- custom search query database in child theme
- can’t delete a row from post_meta table
- Processing forms with php to wordpress database
- How to set max users to 17.000
- Passed variable gets undefined variable error on insert on next page
- How to set up an auto delete post?
- two wordpress sites, two themes, one database, same content
- Insert double entry in DB
- How to connect database table to each registered wordpress user.
- Let users register weight each day and save it in DB
- MySQL database migration to WordPress
- Custom query_posts() parameter
- How to edit the default database of WordPress [closed]
- Display total count of products in orders of a specific order status
- Execute multiple PHP Snippets causes error?
- Bulk data save in custom table
- How to fix ‘Notice: Undefined index:’ in PHP form action
- How get value from URL
- Genesis – Customize search form
- Is XAMPP faster than running LAMP in WSL on Windows 10? [closed]
- Get updated query results on page after insert in database
- Hacked WordPress website /Homepage redirect [closed]
- How i can obtain all the post meta for a specific post as an array?
- Front end file upload returning wrong attachment url
- Passing in MySQL prepare statement parameter separately throwing error
- Database SQL query error
- MYSQL TIMESTAMP when adding DATE_FORMAT then the output is blank, PHP conflict?
- Updated Php version from 5.4 to 7.2 and getting “PHP installation missing the MySQL extension needed by WordPress”
- Retrieving and Displaying Data From a Table
- Need help with format of nested array in MySQL
- Splash pages on a high traffic site
- Data inserted in database, but ajax calls error function
- How to set variable to specific field when querying