Get some ideas from people

I am building an internal POS System for one of my companies.
What I need to do is be able to either:

A. Sell to a cash customer
B. Sell to a customer on the system.

I am thinking of doing it with sessions, however I have it working when selling to a customer on the system, but if I remove the session (which the customer db is filtered) then it always returns the last entry on the BD. I need this to clear the query so there is no data. Any ideas on how to do this or if you have a better suggestion of doing it.??

So when the session variable is not set the query is returning a value, in your case the last in the system?
Can we see the query?
Has the session timed out or do you actually destroy the session i.e. session_destroy()
PHP, ASP or ,net?