I have the two tables below.
The table jobs will have a user id stored in the added_by field.
The table users will have the username stored along with an id.
I want to select the username by matching up the id in the added_by field, with the id in the users field.
Thanks for any help offered.
This is the jobs table
Field Type Null Key Default Extra
id int(11) NO PRI NULL auto_increment
title varchar(255) NO NULL
description text NO NULL
priority int(1) NO 1
added_by int(11) NO NULL
added_on time NO NULL
completed int(3) NO 0
date_completed timestamp NO 0000-00-00 00:00:00
This is the users field
id int(11) NO PRI NULL auto_increment
username varchar(30) NO MUL NULL
password varchar(32) NO NULL
email varchar(255) NO NULL
level int(1) NO NULL
select j.title, u.username from jobs j left join users u on u.id=j.added_by