PDA

View Full Version : Want to track User Title in the Sessions table


JoshFink
07-21-2001, 08:19 PM
If someone could help me out with this, I would really appreciate it. I want to track user title in the sessions table. Now I know I need to add a column in the sessions table called usertitle, but how would I go about updating that table with the usertitle everytime the sessions table is updated?

Thanks Alot,

Josh

JoshFink
07-23-2001, 04:23 PM
Anyone have a clue?

Thanks,

Josh

JamesUS
07-24-2001, 06:00 AM
Why do you need to track user titles? If you use a query like this:


SELECT * FROM session LEFT JOIN user ON user.userid=session.sessionid WHERE userid=$userid;


That will give you access to all records from the user table (usertitle, username etc) and all records from the session table as well.

JoshFink
07-24-2001, 07:19 PM
I want to try and lessen the amount of queries that I'm running. it's something that's going to run right by the Who's online, so I figure if it's already in the table then I will save a qeury and not slow things down.

Thanks,

Josh

Freddie Bingham
07-24-2001, 07:45 PM
If you were to change this lineSELECT DISTINCT session.userid,username,invisibletoSELECT DISTINCT session.userid,username,invisible,usertitlein index.php you would have access to the usertitle of each person logged in.