I’m not entirely sure this is the right place for this question, but I can’t say I know of a better place. 🙂
Your rough proposal is a valid way of building said system, but I would argue that you’re losing all of the advantages of using WordPress with the stated method. By creating a new table you have to build all of the “extras” around it. All of the special methods for finding the data you want, or accessing the relationships you need. WordPress already has a table meant for this type of data, it’s called usermeta
(generally prefixed to be wp_usermeta
, or in code $wpdb->usermeta
).
It’s structured in such a way as to be open to just about any type of content with WP_Query
having special filters (meta_query
) for handling the sorting of the data and with the WP_User having methods (get_user_meta()
) to access the DB data without having to write any SQL.
Related Posts:
- Getting wrong relationship value in $args in wp_Query?
- Using AND and bracket grouping in SQL not working
- Should I use wpdb prepare?
- Does using set_transient() function can lead to MySQL problems?
- How to make WordPress plugin check for database changes and then do something?
- How to get data from WordPress $wpdb into React Gutenberg Blocks Frontend?
- How is the data stored in the database?
- Retrieving custom fields with $wpdb->get_results
- Display only certain posts based on visitor’s country?
- Really simple query giving error in SQL syntax
- How to add SQL file with PHP to WordPress database [closed]
- How can I free up the memory used by update_post_meta?
- Passing array of strings to a SQL statement in a WordPress plugin
- Activation hook not creating table
- Is the usage of ON DELETE CASCADE wrong or not allowed on wordpress?
- How to edit mySQL wp_posts table from plugin php?
- Version upgrade: can my plugin filter the SQL statements issued during a database upgrade?
- $wpdb -> Batch insert from XML File?
- query users by role
- WordPress database error for query INSERT INTO
- How to connect to AWS RDS external database (not for the core WordPress db)
- SQL query for custom taxonomy slugs
- How to add user details to different tables immediately after user registration
- mysql_real_escape_string() vs. esc_sql() in WordPress
- How to get all queries’s results after they have executed?
- $wpdb->prepare with LIKE and sprintf
- Alternative functions for mysql_free_result and mysql_ping in wordpress functions
- How to optimize multiple insert into wordpress database
- Two different wordpress sites – same server and IP address. Gaining Access to database 1 of 2
- How can I programmatically change a MySql variable (foreign_keys_check)?
- Auto-complete or auto-suggest from stored data in database
- What might be the reason of Couldn’t fetch mysqli_result on another domain?
- wpdb->get_var always returning 0
- $wpdb->prepare is not working like mysql_real_escape_string
- Brainstorm – Slow Query from Plugin Need to Speed It Up
- Create an user on external database
- What could cause a WP Option to get truncated?
- WordPress database error: [Query was empty] – using $wpdb->prepare()
- Foreign wp_users ID in custom plugin DB table?
- How to Get Last ID?
- How to store sensitive user data (passwords)
- Insert, update or remove data from database (usermeta)
- WordPress how do I echo SUM from a column of a MySQL table by user id AND type_operation
- Why is that only the first row getting inserted into Mysql table when i import csv file on backend custom plugin?
- Error Connecting to Database WHEN Installing WordPress on XAMPP [Tried All the Usual Stuff] (Pics Included)
- Is it possible to replace MySQL with JSON files for WordPress
- WordPress doesn’t create table on plugin activation
- WordPress delete mysql rows with string
- pull data from wordpress database
- Plugin MySQL SELECT custom data and filter on user meta
- sql query not working in wp plugin
- $wpdb Mysql trigger problem
- Custom MySQL query to pull out Advanced Custom Fields?
- I can’t write in my DB using $wpdb->insert
- How to filter get_adjacent_post()?
- $wpdb how can i save my postmeta table before querying it
- How to add chunk of php, html, and sql code to variable an append to $content
- Nothing happens on WordPress Update command
- Get all the related data from WordPress DB
- select rows based on exact time (hours, minutes and seconds)
- How to properly prepare a column name if passed to a stored procedure?
- Get thumbnails with array sizes parameter
- How remove trashed WooCommerce orders from wc_get_orders() result?
- Adding custom stylesheet into header.php using a plugin
- How to properly package a block plugin
- Why would someone use function_exists(‘add_action’) in a plugin?
- Setting global block attribute value
- Developing the save function in Gutenberg blocks
- Plugin custom post template; without overriding all posts
- Full documentation about $args for register_rest_route?
- How to create post favorite function without plugins
- WordPress Gutenberg InnerBlocks renderAppender not showing with template
- Mock a dependency of a WP_REST_Controller class
- Creating an installation zip file
- How to use nonce
- Remove All Taxonomies from Post On Update
- update_callback is not working in register_rest_field
- how to insert missing tags into the posts through mySQL?
- Run uninstall.php if a checkbox is checked from settings page
- WP Still Generating 150×150 Thumbnail Size Even After Un-Setting Small Size in Functions.php
- How to create ShortCode
- Where to use nonce
- Plugin index page code executes multiple times
- How to call code when adding WooCommerce menu items via woocommerce_account_menu_items
- Is it possible to load the css just on my plugin admin page?
- Duplicate shipping method logic to another shipping method [closed]
- How do I validate extra pin field on my WordPress login form page?
- REST Endpoint API 404
- add_action pre_term_description vs. pre_category_description
- How to check whether checkbox is checked in WordPress customizer
- How to create a wordpress widget that dynamically changes according to the page
- How to disable a jQuery plugin on WordPress plugin page
- jquery in wordpress plugin with depdendency
- Problem with autoloader and namespaces
- DB Query not working in Plugin
- Non editable custom taxonomy
- How to Get Rid of Unwanted Backslashes in WordPress Form Input inside admin menu option
- Gutenberg – is it ok to load dependencies multiple times?
- Show Mysql table elements as pages in WordPress
- Is it possible to use WP-CLI in a plugin (or theme)?