To do that with WordPress functions, you can try that
$users = get_users();
?>
<table>
<tr>
<th>Customer Name</th>
<th>Customer Details</th>
</tr>
<?php foreach ($users as $u) {?>
<tr>
<td>
<?php echo htmlspecialchars($u->display_name);?>
</td>
<td>
<?php echo htmlspecialchars($u->description); // retrieve the meta "description"?>
</td>
</tr>
<?php }?>
</table>
<?php
Related Posts:
- How to use $wpdb to delete in a custom table
- get_results on large datasets
- Is there a (better) way to access $wpdb results?
- Using $wpdb generates DB error
- How do you use prepare when asking for a list of id’s
- how to execute different sql query in non-sanitized $wpdb->get_results function
- WPDB update row with != in where clause
- How to update records using $wpdb?
- Need help writing a $wpdb query
- show badge with count for pending items in custom post type
- WP Sql query multiple where clause
- WordPress SQL query – returning ‘true’ ‘false’ or ‘null’
- Modify the structure of data returned by $wpdb
- Syntax for $wpdb->prepare when searching in two columns
- Confused by $wpdb->prepare
- Optimizing WordPress Queries – Removing Group By ID
- How can I combine one field using wpdb and group by?
- $wpdb->prepare with ON DUPLICATE KEY UPDATE
- how to use $wpdb->prepare to update a custom table
- WPDB Placeholders and second argument for prepared statements
- Increment integer field in database when WHERE needs to be dynamic [closed]
- Custom SQL query ORDER BY term_order
- Custom $wpdb returns unexpected time based results
- How to left join meta in queries [closed]
- wpdb->get_row is selecting the variable as a column name
- CREATE TABLE with dbDelta does not create table
- $wpdb query outputs php code instead of executing it
- wpdb query not working
- WordPress wpdb->insert returns int(0) => doesn’t insert anything, no errors!
- WPDB SQL Ignore `post_status` Parameter
- how to list all post that are in the custom taxonomy using $wpdb
- WPDB SQL query SELECT from category
- How to use WHERE NOT EXISTS query to avoid duplicate entry using $wpdb to save in custom table?
- Creating an Angular factory from custom database table
- wpdb->update update the entire table instead of one row
- How do I update post based on meta_key in another table?
- How to set up prepared query using IN statement
- Custom database query to validate data
- Alter the main search query to search posts by coauthor user name
- Creates only one table and not the other
- Protect custom form from SQL injection
- looking for a way to allow users to backup the plugin db data(save as)
- SQL Query to select post title & post ID from a particular category
- Get comments after specific date
- query using wpdb in wordpress gets me no result
- Get count of rows based if column exists in two different tables
- query_vars doesn’t return query string (trying to get data from $wpdb)
- $wpdb->get_row() only returns a single row?
- what is the way to see the currently executing query in wordpress?
- $wpdb->last_error doesn’t show the query on error
- Multipart/formatted MySQL query problem
- How to make an activities stream mixing posts and comments?
- Delete/replace img tags in post content for auto published posts [closed]
- What does wp_update_post() do that the $wpdb class does not?
- wpdb-> not adding prefix to custom table
- WPDB: how to get the value of a field in a custom database table
- Get WooCommerce product attribute taxonomies in a SQL query on WordPress database
- I am not understandinhg $wpdb->prepare correctly
- How to save html and text in the database?
- XOR functionality for meta_query
- Using WPDB class
- How can I migrate mysql_fetch_array to $wbpdb?
- wpdb get_results() and prepare when to use prepare?
- how to delete 30 day old data using PHP [closed]
- Return XML of Post Metadata
- Querying wpdb using PHP
- Q: How to pull data from custom table to populate zustomizer setting/control select options
- Code only works every other time its run
- WordPress SQL Issue not returning correct reselts
- I can’t figure out what’s wrong with this statement. $wpdb->query update
- Can’t pass variable in wordpress wpdb->get_results
- Custom Query – Based on user input
- How do I count columns on a custom WPDB query?
- Trouble inserting string containing quotations marks with wpdb in save_post hook
- Trying to get variable from WP table and toggle its value
- How can I add a new row in a separate database when someone registers via WordPress?
- Clear Terms from Taxonomy for Specific Post IDs?
- How to prepare an array of values with $wpdb
- $wpdb->insert() doesnt work anymore
- Where can I see MySQL hostname and port for wp-config.php
- $wpdb->get_results not returning an array
- query a newly created table using $wpdb
- WPDB Query Question with Category Only
- wpdb result arrray inside an array
- Fetching review value using wpdb class
- $wpdb->num_rows doesn’t work
- How can I change my meta_query to SQL wpdb query?
- Database SQL query error
- How capturate wpdb exceptions?
- Limit left join
- Get records from Formidable Table using $wpdb->get_col
- I am using wpdb but it not working perfectly.but if I dont use form data its work
- What argument does my function need to echo get_results() query results
- Missing argument 2 for wpdb::prepare() [duplicate]
- Save customizer default values to DB on theme activation
- Plugin with connection to database – Single function
- wpdb->update error
- Wpdb generates too many queries
- Using $wpdb to update current post
- DBDelta: “table doesn’t exist” for a table that was just created