0
i can give the logic only
when u want to search data must be click on serach button and after that you to database for executed query . i think till now this is happend as per you.
now create a table named tbl_user_search and columns are user_id INT, user_search NVARCHAR(MAX)
now when you search data u insert data in this table with some special delemeter
and when u want to show the last search data split data based on the specialdelemeter