You would need to "variables" : members logged in and visitors logged in. If a user logged in, you increment members logged by 1, but if a visitor comes on your site, you increment visitors logged in by 1.
Deeper, you could create a table...
id | type | date
id is... the id of the visitor...
type is "member" or "visitor"
date is the date when the person logged in.
To know the number of visitors, make a mySQL query statement that counts any entry which has type defined to "visitor" and date bigger that now() - "some time"... same thing for members, but you define type to "member"...
Is it clear ?!