Get all products from WordPress database using mysql

SELECT p1.`post_name`,
p2.`guid`,
`wp_postmeta`.`meta_key`,
`wp_postmeta`.`meta_value`
FROM `wp_posts` p1
INNER JOIN `wp_posts` p2
ON p1.`ID` = p2.`post_parent`
INNER JOIN `wp_postmeta`
ON p1.`ID` = `wp_postmeta`.`post_id` where `wp_postmeta`.`meta_key`=’_price’

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s