Problem about joining two tables
Posted: Fri Dec 23, 2005 7:28 pm
Hi again.
I have a query like this:
where $uname is the variable that holds the username of the user that signed in. (its coming from the session)
but it is not executing the query, i know something is wrong but i can not fix it.
the thing that i want to do is:
the user, that is signed in, is registered in "users" table. I want to find the rows in education table that has the username (the username of the user that logged in). i learned that, combining two tables is like that above. But theres some error about "u.$uname". What will i write instead of it?
Thank you again and again for helping me...
Code: Select all
$query = "Select e.id, e.username, e.sdate, e.edate, e.school, e.location
from education e, users u
where u.$uname = e.$uname";but it is not executing the query, i know something is wrong but i can not fix it.
the thing that i want to do is:
the user, that is signed in, is registered in "users" table. I want to find the rows in education table that has the username (the username of the user that logged in). i learned that, combining two tables is like that above. But theres some error about "u.$uname". What will i write instead of it?
Thank you again and again for helping me...