database query meta_value partial
-
On my site, each post is an event that can have many dates, and for each date there is an associated time. I am storing the pair in meta_value with the string ‘YYYY-MM-DD @ HH:MM’. I am able to store the string, however I cannot figure out how to make a query that will find posts with the meta_value that starts with a certain date. For instance, if I want to find all events on 2012-02-18, then I should use a mysql WHERE meta_value = ‘2012-02-18%’, right? However, I can’t get any mysql searches to work. I’ve tried direct MYSQL scripts, I’ve tried get_row, get_posts, get_results. Nothing works. Can anyone help me write a function that returns the array of objects like get_posts that contain the posts associated with these meta_values? Thanks.
- The topic ‘database query meta_value partial’ is closed to new replies.