well i am trying to write a simple script for my online ticket shop ... just for local area based ... I have managed to install a open source PHP login script and designed a simple template and thats all there is in my site for now .... I have been planing to put some custom Field in registration form where user can input a verification code and the amount of tickets they want and when they will enter the code and the amount of tickets then they will have the ticket in their account from my database where i have already stored them ... In my database i have a table called 'ticket' and inside i have 'id' , and some 'html' code in text field Now i have managed the verification process and stuck at here .... well , when a user will demand , for instant - 5 tickets then the ticket from 1-5 will store in their account and if another user demand 6 tickets after that then the ticket 6-12 will go to their account .... Any kind of help will be appreciable like working code or Pseudocode