The first section of your code is correct
global $wpdb;
$table_name = $wpdb->prefix . "wplusersprofiles";
$user = $wpdb->get_results( "SELECT * FROM $table_name" );
The problem is in the way you tried to fetch the individual row data. The get_results function in your case returns an object array. So the correct way to fetch individual data should be like…
<?php foreach ($user as $row){ ?>
<tr>
<th><label for="gender"><?php _e("Gender"); ?></label></th>
<td>
<input type="text" name="gender" id="gender" value="<?php echo $row->gender ?>" class="regular-text" /><br />
</td>
</tr>
<?php } ?>
Related Posts:
- Difference between partition key, composite key and clustering key in Cassandra?
- How SID is different from Service name in Oracle tnsnames.ora
- What is a relation in database terminology?
- Why WordPress choose data serialization over json_encode?
- Relaunch 4.2 utf8mb4 database upgrade
- Are There Any Plans for WordPress to Support Databases Other Than MySQL?
- Reset Post IDs to less than 64bit integer
- Where can I find the database changes between WordPress versions?
- how can get database name in wordpress?
- Does WordPress use the InnoDB engine for MySQL by default?
- $wpdb->prepare() warning in WordPress 3.5
- When is it appropriate to create a new table in the WordPress database?
- Best way to import users, post and categories from an external database
- Performance tips for a large user base [closed]
- How to delete outdated, wrongly sized images in _wp_attachment_metadata?
- wp_options is GB in size
- Can’t update database after wordpress update from 3.8.1 to 4.4.1
- Get Database Credentials from within the themes file
- what to do when your WordPress database is too large?
- How does WordPress create its database during installation?
- How to use user table of a different database for WordPress users?
- Subscribers to posts
- $wpdb->update has finished saving trigger?
- Having issues with wp_postmeta and wp_usermeta tables too big
- WordPress site uses MyISAM, should I switch to InnoDB necessary?
- WP Database Table to CSV file
- For WordPress is there content in the database which I can safely ignore?
- How can I UN-orphan media files?
- Does WordPress always create unique passwords?
- Uppercase to sentence case for post titles
- Merge two WordPress installations into one, and keep posts separated?
- Moving online website to MAMP or dumb idea?
- WordPress database import: Row size too large
- Advanced SELECT query with condtional statements
- Export / import WordPress database
- WordPress choose wrong database
- How can I (semi) automate a database export and import to a different location?
- Is it safe to delete unnecessary user metadata?
- Improve performance by removing unnecessary database queries
- Redirecting to old domain after migration website
- WordPress Relational Database
- Switching Databases in LocalHost
- Localhost keeps redirecting to live domain
- How to update the values when the featured image has changed?
- Does WordPress $wpdb functions wait when table is locked?
- Unable to set a default serialized array using dbdelta()
- Importing 10 Years of Media into the WP Database
- 2 WordPress sites with 2 databases but sharing the same users
- How to get nav_menu_item_id and slug from wp database
- connecting to DB from custom php file
- Is there a way to execute a php script outside WordPress?
- Make changes of wp-db.php file persistent against updates
- How can I restrict php mail() to only send me one email after a db error
- Change the default data installed when setting up WordPress
- How to delete post comments from the database via SQL statement?
- Clear Terms from Taxonomy for Specific Post IDs?
- Why does changing Database Table Prefixes result in loss of content?
- How to split the WordPress database?
- $wpdb->get_var – What value is returned when zero records are found?
- wp_option table error while importing
- SymmetricDS in dev + prod workflow?
- Fixing YARPP plugin FULLTEXT MySQL indexing
- What is wrong here? Issue with post_id and meta_value
- Only allow user to access a link once a year, based on their joining date
- Error establishing a database connection in wordpress site , website not opening
- Counting post and changing roles in mysql database. Query not code
- wpdb Insert unknown post data dynamic foreach loop
- How do I use a database in a custom theme?
- Deleting empty meta key values
- I imported an restore an database and It shows #1067 – Invalid default value for ‘user_registered’
- WP 5.5, child themes, customizer and a weird cache issue
- Migrating meta_key and meta_value from old theme to new one
- How do you enable scripts on a WordPress installation in Softaculous?
- How to rerieve comments and their replies from DB
- Inserting data with Geometry field
- Export only a part of the database for migration
- Why am I being prompted to reinstall wordpress?
- What’s the easiest way to connect external database and display data on wordpress?
- database error WordPress move from one hosting to other
- Select data from foreach loop and send it to wordpress database
- Error establishing database connection error during first WordPress run
- Same DB for live and dev versions
- update multiple user meta field based on another meta field
- After renaming MySQL database, I can no longer access my Blog page
- execute custom function on database connection error
- Call to a member function insert()
- Create a new table on the database and save parameters from a contact form
- not saving post in wp_post wordpress database table
- How to have WP Search widget index dynamically generated content?
- How to add data from wordpress tables to new database tables you have created
- Creating Tables in WordPress Database
- Calling update_user_meta inside of another function doesn’t work
- Install WordPress with SQL database
- How to back-up a database on IIS
- $wpdb->prepare returns empty array
- Where are database files of a WordPress website?
- wp-config was suddenly updated
- Weird WP -Cli Error Connection Refused
- Order of search results based off of a backend custom field and also in alpha order
- How to find fresh (last modified) and sql backup?