You had not very good architecture for your application. Best way is in save user information in one table and use separated fields or linked table for save extra information.
In your case you case use UNION and check tables in one query.
And correct way is use SELECT COUNT(*) and check result instead SELECT *
Related Posts:
- How to return number of found rows from SELECT query
- what is the use of /wp-includes/SimplePie?
- Inserting dynamic content into a page
- Check if post of title already exists
- How to export/import theme customizer settings?
- $wpdb->delete column values IN ARRAY()?
- Inserting choice in database table
- WP API V2 returning Invalid User ID
- How To Make Connection To WordPress Data Base In A Plugin?
- Has anyone tried putting PHP ActiveRecord on WordPress?
- How to auto login user again after change user_login
- WordPress admin never finishes saving page on site with large page count
- Retrieving and Displaying Data From a Table
- Duplicate domain database to local – How?
- 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?
- WPDB: how to get the value of a field in a custom database table
- Notice: wpdb::prepare was called incorrectly. The query argument of wpdb::prepare() must have a placeholder
- Access/update database with jQuery
- How to migrate the posts from an old custom legacy blog to a new WordPress website?
- #1062 – Duplicate entry ‘1’ for key ‘PRIMARY’
- How to create and work with custom data / tables (i.e., for arbitrary data)?
- Add custom php database code above
- wp_insert_post not working
- Prevent Data Resubmission On Page refresh
- SQL QUERY – Select a value directly from the database
- Any possible way to make $wpdb->get_results() return anything else than array?
- Transferring working local PHP site to wordpress – with database (MySQL)
- Accessing the database from a plugin outside of action hooks
- Getting id of poll from WP database
- Storing Array from returned database query and using the array in a new query
- WordPress not reflecting changed of the database
- How to save checkbox values for logged in users?
- How does WordPress know wich language is chosen when there is a database connection error
- How can I save unique user data on my site? [closed]
- Dynamic content in template
- Using custom tables for old posts
- db converts decimal number wrong
- Not connecting to database in file with multiple MySQL connections
- How can I import an excel column into wordpress database?
- WordPress Block developer from exporting Database via PHP
- Execute a function every hour in the background
- Create page with custom php script and fetched data
- 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
- Building a REST API for your web app exposes primary keys of DB records?
- Most commented posts by time period (last 12h, last 24h and etc)
- wpdb Cannot Update column in Database
- Cant connect to database with php 7.3
- Set default Database Storage Engine when creating tables with plugins?
- WPDB – Read and write value from / to database
- How do I make this Metabox show current DB value?
- How to Generate a list of Most Commented post?
- Why when I create a new post I found 2 record related to this post into the posts database table?
- SQL error with custom query
- Unserialize Custom Field & Save as Multiple Rows in WordPress Database
- What’s wrong in my PHP code? I’m using WordPress Astra Theme and I can’t insert data into my SQL
- Tracking Visitor LatLng with WordPress using JS, PHP. How to put data which was extract using JS into DB
- $_POST returning empty values
- How to send custom form submissions to WordPress Database?
- Submiting with problems on one of the options php wprdpress
- wp_update_post gives 500 internal error
- Confuse between forms and tables
- code that I can run, or a plug in to show what sql tables something pulls information from
- Adding column to wpex_users
- Using wpdb to connect to a different database is not working
- why not selecting multiple rows of same standard_id using SQL query from database?
- getting the values of hidden inputs to use them in a php mysql query
- custom search query database in child theme
- wp-login.php?redirect_to=https problem
- Insert data from form to database
- How to query a staging database?
- Get meta_query value by user meta array
- I changed the password for the database user of my website, updated wp-config.php and wordpress asks to be reinstalled
- I want to use wordpress database in android app using json encode?
- Accessing external database: ERR_INCOMPLETE_CHUNKED_ENCODING
- Can form entries from a WordPress form go to a database
- AJAX Not Working With WordPress Database properly
- Weird Behaviour: Not all WordPress Posts appearing
- Can not manually create a database ( db, user, pass ) for a plugin
- two wordpress sites, two themes, one database, same content
- Insert double entry in DB
- Manipulate database of WordPress site with my own scripts
- Problems with plugin that fetches data from database with ajax
- Check if values exists DB
- MySQL database migration to WordPress
- Host does not allow remote connection, so how do I transfer data to my WordPress site?
- MySQL Engine vs. Charset
- Custom query_posts() parameter
- How to pass username into form that sends data to database
- How to edit the default database of WordPress [closed]
- Insert into db with foreach problem
- notify users when changed database
- Execute multiple PHP Snippets causes error?
- Putting form result in my database
- Bulk data save in custom table
- WordPress Insert line in DB when clicking a button
- Updates applied to staging WordPress site affecting production even with different databases