Composite Primary Keys

Here’s a good introduction to composite primary keys by Jeff Smith. When you’re defining a database table that’s being used to relate two other tables (e.g., products_discounts to map discounts to particular products), you should always create it with a composite primary key (i.e., both the product_id and discount_id columns) rather than a single identity column […]

Continue reading...

Including External View Files in WordPress Widgets

I ran into a problem today while cleaning up and modifying some widgets. I moved all of the markup inside widget() to an external view file, and then included it via require_once(), which worked fine. I then tried to do the same thing inside form(), but didn’t get any output. It turns out that you […]

Continue reading...