lime icon

Phosphorus and Lime

A Developer's Broadsheet

This blog has been deprecated. Please visit my new blog at klenwell.com/press.
SQL: left join
An example using PHP variables:

SELECT * FROM $T_primary
LEFT JOIN $T_second ON $T_primary.ID = $T_second.primary_ID
LEFT JOIN $T_third ON $T_primary.ID = $T_third.primary_ID
WHERE $T_primary.ID = $some_value


Not sure if this is the optimal query, but works at something like getting user data spread across tables.