I got a question. I will try to describe my situation:
I got a wordpress installation which i installed codeigniter in. This all goes good and i also got access to t
It sounds like you're trying to get several pieces of data from different rows in the same table, which means you need to do more than one join. Does this get you what you're looking for?
$sql = "SELECT p.id, p.post_title, p.guid, p.post_type, m.meta_key, m.meta_value, meta_sp.meta_value as sale_price, meta_ap.meta_value as additional_price
FROM wp_posts p
INNER JOIN wp_postmeta m
INNER JOIN wp_postmeta meta_sp ON p.id=meta_sp.post_id
AND meta_sp.meta_key='sale_price'
INNER JOIN wp_postmeta meta_ap ON p.id=meta_ap.post_id
AND meta_ap.meta_key='additional_price'
WHERE p.id=m.post_id
AND m.meta_key='_rentable' AND m.meta_value='yes'
";