Hi, I’m trying to do some custom Database stuff with Wordpress. I think I’m close to getting it working, but I’ve hit a wall. Basically, here’s the scenario. I’m using Wordpress to create hidden content that updates a website outside of the wordpress installation. I’ve gotten the content hidden and the DB connection is working fine. I can pull values from the Database on the external website, but the values are not being pulled the way I want them to be. Looking at the database table will help illustrate:
http://img18.imageshack.us/img18/1387/sqlt.png
I have two kinds of posts: News and Blog. What I want is the following:
When the story is type ‘blog, pull all the values under the meta_value column that are associated with posts of type ‘blog’. So if you look at the screenshot, post_id 80 is type ‘blog’. I want to pull, the date, the title, the URL the lead-in content.
The problem seems to be that all those values are in the same column (meta_value). I tried using the WHERE IN SQL command:
SELECT meta_value FROM wp_postmeta WHERE meta_key IN ('url','pdate','ptype','_wp_attached_file','title','lead-in')
But it’s returning rows that I don’t want. How can I filter these rows down to use the two qualifiers: ‘news’ or ‘blog’?
Thanks for any help in advance.
Regards,
Matt