Rotating invoice number

Discussion in 'Programming' started by kalseo, Dec 30, 2008.

  1. #1
    Hi DP members,

    Just implement payment gateway system for one of my projects, unfortunately i need to change invoice number manually every time.

    How i can do it automatically? Is there any script that can help me to replace it after customer make payment. This is part of form that my bank offer me.

    Invoice No :<INPUT type="text" id=INVMERCHANT name=INVMERCHANT value="000000009999"></form><button onclick="document.sendform.submit();">Submit</button><!--<script>document.sendform.submit();</script>--></body>
     
    kalseo, Dec 30, 2008 IP
  2. champ

    champ Member

    Messages:
    30
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    48
    #2
    You should probably be storing the invoice number in a database and query it for the max value then add 1 to it:
    SELECT (MAX(invoiceno) + 1) AS invoiceno FROM invoices
    Code (markup):
    You could also just write the number to a file every time your customer makes a payment. Later you'd just read the line from the file using a script.
     
    champ, Dec 30, 2008 IP