i have two tables, one with username/password information, and another with logs. in the log database one of the fields is the userid that triggered the log, where userid is the primary key of the users table.
i am using the following query to join the username ( 'user' ) onto the result.
SELECT logs.*,users.user from logs inner join users on logs.userid=users.userid order by id desc;
the problem that i have is, if the log was triggered by a user not logged in, then the log has a userid of -1. when i run this query with the inner join, the id does not match anything so that log is not part of the returned rows.
can anyone think of a way around this? thanks in advance.