Right now I have a small database with two tables that look something like this:
users table
====================
id name status_id
1 Bobby 3
2 James 2
and
statuses table
=============
id value
1 Waiting
2 Approved
3 Other
status_id is setup as a foreign key constraint to id from the statuses table. My query looks something like this:
SELECT *
FROM `users`
WHERE `status_id` = 2";
When I display $row['status_id']
it outputs 2
but I would like it to display as Approved
instead, what is the best way to accomplish this?