Ticket Pin Generation (Urgent Request)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kossanah
    New Member
    • Nov 2006
    • 3

    #1

    Ticket Pin Generation (Urgent Request)

    I like to seek to your assistance in any measure.I need your help on how to go about This:



    I am developing a promotional site where user will be issued a ticket(manually ) which will be a unique 10 digit alpha-numeric digits.The ticket will be issued out manually at a Company sales point once they purchase at the store. This is intended for this season's promotion. The user will use the Ticket no. to fill out a form provided online.

    User will enter this Ticket number along into a form on the website.

    Users can enter as many ticket number as they wish but no two user can enter same ticket number.



    The Ticket number will be selected at random for The Promotion winner.

    I have come accross the PHP function for generation of random number



    Use mt_rand( ):

    // random number between $upper and $lower, inclusive
    $random_number = mt_rand($lower, $upper);

    I plan that user will create an account on the site if they do not have one already.And can add more pin(ticket no) anytime to increase their chance.

    I need help on how to deploy this in relation to connecting the generated Ticket Pins to be authenticated in mysql for validation.
    So I do not if I should store the Ticket Pins in the database,or is their a better option?

    Please help will with useful guide on how to execute this task.

    Thanks for you usual support



    Sincerely

    kossanah
  • ronverdonk
    Recognized Expert Specialist
    • Jul 2006
    • 4259

    #2
    You'd have to store each ticket number given out in the database, how else would you avoid (eventual) double numbers?

    Then when the customer enters his credentials, this data is also stored in the db. You must then give the customer a unique customer id and assign that to the already stored ticket number. How else can you relate a ticket to a unique curtomer?

    Ronald :cool:

    Comment

    • kossanah
      New Member
      • Nov 2006
      • 3

      #3
      Originally posted by ronverdonk
      You'd have to store each ticket number given out in the database, how else would you avoid (eventual) double numbers?

      Then when the customer enters his credentials, this data is also stored in the db. You must then give the customer a unique customer id and assign that to the already stored ticket number. How else can you relate a ticket to a unique curtomer?

      Ronald :cool:
      Thanks for your nice tips, but I like you to make your suggestion more clear to me practically.
      1. If I issue Ticket number along side a Customer ID. Well thats a good practice... Remember this will be issued manually...
      2.Do I store this two value in the database? each Ticket no unique and related to a customer Id..
      3.How do I make sure achieve a senerio where any customer can enter more than on Ticket into his account , as you know this can increase their chances of selection.

      Comment

      • vssp
        Contributor
        • Jul 2006
        • 268

        #4
        base64_encode()
        base64_decode()

        using to generate the random key

        vssp

        Comment

        • ronverdonk
          Recognized Expert Specialist
          • Jul 2006
          • 4259

          #5
          Think about the following setup:

          1. a new customer walks into the store, gets a ticket number along with a credentials form, fills in form:
          - credentials (new customerno) entered in the database table 'customers'
          - ticket number from table 'tickets' assigned to that customer id

          2. walks in again and already has an customerno
          - knows his customerno (or you look it up manually in 'customers' via name or something)
          - enter the customerno and assign the new ticketno to his customerno in table 'tickets'

          I'd suggest 2 tables:
          - 'customers' holds all customer info (customerno as key)
          - 'tickets' containg predefined ticktnos and a column to hold the customer no

          Table relation as in the following table setup:
          Code:
          +------------------+       +---------------+
          | TABLE customers  |       | TABLE tickets |
          +------------------+       +---------------+
          | customerno (KEY) |<--+   | ticket number |
          +------------------+   |   +---------------+
          | name             |   +-->| customerno    | 
          +------------------+       |  or empty     |
          | address          |       +---------------+
          +------------------+
          | etcetera.....    |
          +------------------+
          Ronald :cool:

          Comment

          • kossanah
            New Member
            • Nov 2006
            • 3

            #6
            thanks

            Thanks Ronverdonk,
            Your answer was is an extra-ordinary one, i very greatful, keep up the good work.
            kossanah

            Originally posted by ronverdonk
            Think about the following setup:

            1. a new customer walks into the store, gets a ticket number along with a credentials form, fills in form:
            - credentials (new customerno) entered in the database table 'customers'
            - ticket number from table 'tickets' assigned to that customer id

            2. walks in again and already has an customerno
            - knows his customerno (or you look it up manually in 'customers' via name or something)
            - enter the customerno and assign the new ticketno to his customerno in table 'tickets'

            I'd suggest 2 tables:
            - 'customers' holds all customer info (customerno as key)
            - 'tickets' containg predefined ticktnos and a column to hold the customer no

            Table relation as in the following table setup:
            Code:
            +------------------+       +---------------+
            | TABLE customers  |       | TABLE tickets |
            +------------------+       +---------------+
            | customerno (KEY) |<--+   | ticket number |
            +------------------+   |   +---------------+
            | name             |   +-->| customerno    | 
            +------------------+       |  or empty     |
            | address          |       +---------------+
            +------------------+
            | etcetera.....    |
            +------------------+
            Ronald :cool:
            Last edited by kossanah; Nov 7 '06, 07:56 AM. Reason: grammatical error

            Comment

            • ronverdonk
              Recognized Expert Specialist
              • Jul 2006
              • 4259

              #7
              Does this mean that your original question is somehow solved?

              Ronald :cool:

              Comment

              Working...