INNER JOIN same table

I think the problem is in your JOIN condition. SELECT user.user_fname, user.user_lname, parent.user_fname, parent.user_lname FROM users AS user JOIN users AS parent ON parent.user_id = user.user_parent_id WHERE user.user_id = $_GET[id] Edit: You should probably use LEFT JOIN if there are users with no parents.

Explanation of self-joins

You can view self-join as two identical tables. But in normalization, you cannot create two copies of the table so you just simulate having two tables with self-join. Suppose you have two tables: Table emp1 Id Name Boss_id 1 ABC 3 2 DEF 1 3 XYZ 2 Table emp2 Id Name Boss_id 1 ABC 3 … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)