Forum Moderators: coopster

Message Too Old, No Replies

Identifying The Logged On User

         

mhoctober

8:36 pm on Jan 28, 2006 (gmt 0)

10+ Year Member



Guys...

is there a way (in php) to identify the user name used when logging onto a mySQL database?

I want to know this so that I can program a basic audit trail on edited records.

Many thanks...

jatar_k

9:55 pm on Jan 28, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



when we did this we made them login to the site and always added IP and username on any edit. We would drop the old row to a log/archive table and add the other info. We then knew every change, before and after, and who did it.

mhoctober

10:02 pm on Jan 28, 2006 (gmt 0)

10+ Year Member



jatar_k thanks - is there a php function or variable that I can use to extract the logged on user name

something like $login etc...

Regards

jatar_k

10:06 pm on Jan 28, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



we used to store the username in the session so we grabbed it from there