Sql statements in (search)
-
I dont know is this is the right forum for this kind of post, but i’ll try ??
I’d like to show posts in loop but dont know how to create statements correctly. I’d like to intersect all those 3 sql statments:
(*need this for POST search, each select statment represent input)SELECT p.* FROM $wpdb->posts p, $wpdb->postmeta m WHERE p.post_type = 'post' AND p.ID = m.post_id AND m.meta_key = 'x1' AND m.meta_value = 'x2' AND (p.post_content LIKE '%$search%' OR p.post_title LIKE '%$search%')
SELECT p.* FROM $wpdb->posts p, $wpdb->postmeta m WHERE p.ID = m.post_id AND m.meta_key = 'y1' AND m.meta_value = 'y2'
SELECT p.* FROM $wpdb->posts p, $wpdb->postmeta m AND p.ID = m.post_id AND m.meta_key = 'c1' AND m.meta_value = 'c2'
I really appreciate for any kind of tips/help.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Sql statements in (search)’ is closed to new replies.