I am trying retrieve wordpress postmeta USING PHP not WORDPRESS functions, it needs to be in php no wordpress functions please.
this is what I have:
$resultat = mysqli_query($con,"SELECT * FROM wp_posts
LEFT JOIN wp_postmeta
ON wp_posts.ID= wp_postmeta.post_id
where post_type='shop_order'");
the issue here is each meta key is in its own row so this doesn't work :/ any suggestions please?
what I figured could be done is to get all the post ids first , store then in array then retrieve the values of each? let me know what you think
RIGHT JOIN
to avoid some nulls