Is this what you were suggesting?
I echoed the $result and still got Resource Id #4
Also, with echoing $user_id....nothing echoes so it's empty and that is why the it returns the 'Invalid login'?
(Also, the database is called cms with a table called users consisting of four fields (id, username, password, and email) )