[sql] SELECT contestv.ID, contestv.Contest, contestv.Author, contestv.Location, contestv.Date, user.*
FROM " . TABLE_PREFIX ."contestview AS contestv
LEFT JOIN " . TABLE_PREFIX ."user AS user ON(user.username = contestv.Author)
WHERE contestv.ID = " . intval($contestID) . "
[/sql]
That is the gist of a LEFT JOIN...
Some other things: You should really use userid if you are currently using username...it is easier to index and better for normalization.
And column name are simpler to remember if all are lowercase IMO.
|