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.

I need to extend some wp tables (wp_posts, wp_comments, wp_users) to store some additional fields. I can't use metadata because I need to query those values directly via MySQL. I need an help to choose if it's better to extend the original table or to define an additional one with those fields, with a 1-1 relationship to the original one. This second case will require an additional JOIN. Thanks.

eV

share|improve this question

2 Answers 2

up vote 1 down vote accepted

The second approach (joining additional table) is better for several reasons.

share|improve this answer
    
Thank you, the additional fields will have many updates. Thanks also for the useful links. –  eVolts Oct 24 '11 at 14:58

Adding fields to WP's tables seems like a bad idea...what about using post meta and just JOINing on the post_meta table?

share|improve this answer
    
I need to have one record per element and not n records (or need to encode an array, because I need to query each field). –  eVolts Oct 24 '11 at 14:56

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.