How to get users data from wordpress woocomerce database to display

WooCommerce uses a custom post type “shop_order” to store orders. This means that the orders will be stored in the wp_posts database table with the post_type column set to shop_order


SELECT ID, post_author, post_date, post_status, post_type FROM wp_posts
WHERE post_type="shop_order"

WooCommerce stores a large portion of the order related data as post meta.
Once you have the order ID, you can find the customer data by searching the wp_postmeta table by the order ID

SELECT * FROM wp_postmeta WHERE post_id = $currentUser

Find more info https://usersinsights.com/woocommerce-customer-database/

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)