Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Somehow "link" a field in two tables

Status
Not open for further replies.

iranor

Programmer
Jun 17, 2004
174
CA
I have a table named 'accounts' with fields UserId and Username. I have another table called 'logs', where there are fields EventId, UserId, LogDate, EventParams.

Is it possible to somehow 'link' the UserId of both tables? Like, I would like to search throught the logs using the username.

I tried "SELECT * FROM `logs`, `accounts` WHERE logs.UserId = accounts.UserId AND accounts.Username = Someuser" But it didn't worked.
 
What didn't work? Did martians come down in green spaceships?
Did you get incorrect results? no results?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top