Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

So I've been working on created a catalog based off of wordpress's metabox functionality with a custom post type, but now as it comes time to start searching the database to return specific data sets, I'm realizing that I cannot query the data that has been stored inside a metabox because it is being stored as a serialized array in the database. I have been using Dimas' metabox library (which I much appreciate) to process the metaboxes, but then realized that the data was being serialized.

I can't work with serialized data (at least I don't think I can) because I need to be able to query the database to select data sets according to the values of the metabox data.

My question is if I go with the straight building of the metaboxes, like Justin Tadlock's tutorial over at Smashing show how to do, will that data still be serialized, even if there is only one value per metabox? From everything I'm reading it seems to suggest that such is the case. If so, I'm afraid I'll have to work outside the metabox functionality, which I wouldn't even know how to begin.

share|improve this question
    
Use the RW meta box library instead ;) –  kaiser Aug 6 '12 at 23:51
    
Investigating. Thanks for the tip. –  Brent Aug 7 '12 at 0:03
    
Kaiser, That's what I was looking for: deluxeblogtips.com/2011/03/meta-box-script-update-v30.html –  Brent Aug 7 '12 at 0:57
add comment

1 Answer

up vote 0 down vote accepted

As Kaiser suggested, the Metabox script available over at http://www.deluxeblogtips.com/2011/03/meta-box-script-update-v30.html propagates metadata to the database as individual entries instead of a serialized array. I suppose it is ultimately a matter of preference between how you want your data to be stored in the database. I have appreciated using Dimas'WP Alchemy plugin up until now, but now that I need to be able to query the database according the meta value, I needed to be able to access specific values directly. Rilwis'solution adds the meta data to the database as individual entries (non-serialized) which is what I needed.

Thanks Kaiser.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.