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