Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Last Queried

Status
Not open for further replies.

ShawnDT

Technical User
May 1, 2006
67
0
0
US
Good Afternoon Guru's

I am not quite sure I am in the right section. My challenge, I am trying to write code in order to display the last 5 queried items from SQL to an ASP when the user logs in. So when the user logs in it will display their last 5 queried items. Is this possibe to do? Can someone point me in the direction I should go? Thank you for your kind attention.
 
Where do they run the SQL queries at? In an ASP page, in Query Analyzer?

If in an ASP page, you can just write the queries to a table (in this case, I think a text field would be fine). Then pull the last 5 they ran on demand.


[monkey][snake] <.
 
Thanks for your speedy reply! Let me clarify.

When the user logs into the webpage they can search(an input field is used for search-SQL Stored procedures)for particular records. We allow them to search by Case number, plan name, consultant etc. What we want to do is when the user log in it display the last 5 items they searched(History).

For instance: First search was Yahoo, and then the second search was 030-25580 and so on.

each time they search a particular item. It would show part of the search item as History.

Hope this makes sense
 
Seems like you could create a table that contains at the least 3 fields.

timeStamp, userId, and queryContent

At the point that a SP is ran, you can insert that data (tstamp, userid and queryContent) into the table you create. When that person logs in, you can have it set up so that there is a history <div> that contains the 5 most recent searched items.

[monkey][snake] <.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top