Numerical sequence problem

Discussion in 'MySQL' started by jc@ukzone.com, Mar 11, 2008.

  1. #1
    I have a message board that runs in php/mysql. It lists the messages in numerical sequence in decending order:
    $qry .= " ORDER BY reference DESC" ;

    This has worked fine until now.
    The numbers got up to 9999 and then the next number is 10000 was displayed at the bottom of the list.
    Numbers are generated from a text file, which increments OK (it is now on 10013).

    Does anybody know why this has happened and is there a cure for it.

    Thanks

    John C
     
    jc@ukzone.com, Mar 11, 2008 IP
  2. AstarothSolutions

    AstarothSolutions Peon

    Messages:
    2,680
    Likes Received:
    77
    Best Answers:
    0
    Trophy Points:
    0
    #2
    What is the field type it is being imported into?
     
    AstarothSolutions, Mar 11, 2008 IP
  3. jc@ukzone.com

    jc@ukzone.com Guest

    Messages:
    35
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Hi AstarothSolutions..
    Many thanks for asking this question. It gave me the clue that I needed.
    The field type was VARCHAR which I have now changed to INT.
    All is well again.

    It just shows what a DUMMY I am.

    Many thanks for your help.
     
    jc@ukzone.com, Mar 11, 2008 IP
  4. AstarothSolutions

    AstarothSolutions Peon

    Messages:
    2,680
    Likes Received:
    77
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Ack, we are all dummies at times and sometimes you are just so close to the problem that you cannot see the wood for the trees.
     
    AstarothSolutions, Mar 12, 2008 IP