Joining tables

They have: 105 posts

Joined: Mar 2006

Hi,

I have been trying to get this query right for ages, can anyone see why it doesn't work?

$qt=mysql_query("select users.userid, users.name where users.userid = online_users.userid where time > '$tm' and status='ON' LIMIT 0,6");

I want to display users that are online but get display the name of the user from the users table, while using the online_users table. Any suggestions?

Thanks,

I worked out how to do it:

$qt=mysql_query("select users.userid, users.name, online_users.userid from plus_signup, plus_login where users.userid = online_users.userid and tm > '$tm' and status='ON' LIMIT 0,6");