Sometimes I think I haven't got the brain power for programming, I just can't get my head round this.
I've got a table called wp_postmeta which looks kind of like this
+-----------+-----------+------------+--------------+
| meta_id | post_id | meta_key | meta_value |
+-----------+-----------+------------+--------------+
| 1 | 1 | type | movie |
+-----------+-----------+------------+--------------+
| 2 | 1 | name | dark knight |
+-----------+-----------+------------+--------------+
| 3 | 2 | type | tv show |
+-----------+-----------+------------+--------------+
| 4 | 2 | name | lost |
+-----------+-----------+------------+--------------+
| 5 | 3 | type | tv show |
+-----------+-----------+------------+--------------+
| 6 | 3 | name | house |
+-----------+-----------+------------+--------------+
| 7 | 4 | type | movie |
+-----------+-----------+------------+--------------+
| 8 | 4 | name | godfather |
+-----------+-----------+------------+--------------+
What I want to do is select the all the movies. I need to find WHERE meta_key
= 'type' AND meta_value
= 'movie' then get the meta_key "name" where the post_id's match and selet the meta_value thus giving me "dark knight" and "godfather".
Sorry for the poor explanation but Wordpress doesn't have a logical structure to this part of the database, making it quite hard to explain.