Basically; I am on the Announcements page of a Client Control Panel, and I need to show the First Name of whoever made that announcement. I have their contact ID.
$res = mysql_query("SELECT * FROM announcements ORDER BY id DESC LIMIT 3;") or log_e();
/* Returns:
Array {
['id'] = 1
['poster_id'] = 1
['when'] = CURRENT_TIMESTAMP
['title'] = "Example Announcement"
['message'] = "..."
}
*/
An excerpt from the UML design document is as follows:

I have the “poster”, which relates to the “id” in “users”… The “main_contact” from “users” relates to the “id” in contacts. Therefore I know I need to join users on users.id = poster , and … join contacts on contacts.id = users.main_contact ? But what would the whole query look like?
Thank you, first answer. I was able to take your example and form it into a query that will do what I need to do.
SELECT announcements.*, contacts.name_first FROM announcements
LEFT JOIN users on users.id = announcements.poster
LEFT JOIN contacts on contacts.id = users.main_contact
ORDER BY announcements.id DESC LIMIT 3;
Roughly: