A bit on my layout (simplified):
users table
|userid|lastauth|
When a user logs in, lastauth is changed to the authid of the new login token.
auth table
|authid|token|
Given a token, I want to find out which userid it belongs to. I’m not sure if I’m using INNER JOINs right, but this SQL gives out an error:
SELECT users.userid
FROM 'users'
INNER JOIN 'auth' on users.lastauth = auth.authid
WHERE auth.token=1234567890abcdef
Don’t use single quotes for object names. They are only for character literals (where you didn’t use them):
You probably mixing that up with those dreaded backticks in MySQL:
But as your table names are not reserved words, you don’t need any type of quotes around your object names.