thanks for reply bro . my table name is "register" and there is 5 field name . user,status,confirmcode,userid, and password . so if user connected then first check that user name and update his status "logged_in" and if user logged out then again update "logged_out".