I have 2 tables user and user_activity. like
user:- iduser,f_name,type
user_activity:-iduser,type
we have to join these two tables on the basis of iduser and get the all data of user if we select type=1 then get all the data of type=2, if we select type=2 then get all data of type 3 etc...