Default 2147483647

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Faree

    Default 2147483647

    Hi all,

    I am doing portal for storing info of visitors.it is working well
    too.but my prob is with mysql..when i entered infoa bt thier phone
    numbers ,fax or mobile numbers,soemtim es it is storing 2147483547
    instead of given number or default null.can u tell me the reason and
    solution for it.

    Thanks alot,

    Faree.

  • Oli Filth

    #2
    Re: Default 2147483647

    Faree wrote:[color=blue]
    > Hi all,
    >
    > I am doing portal for storing info of visitors.it is working well
    > too.but my prob is with mysql..when i entered infoa bt thier phone
    > numbers ,fax or mobile numbers,soemtim es it is storing 2147483547
    > instead of given number or default null.can u tell me the reason and
    > solution for it.
    >[/color]

    A bit more information would be helpful, like the actual query you're
    using.

    But my guess would be that you're storing the information in a numeric
    column type.

    --
    Oli

    Comment

    • Faree

      #3
      Re: Default 2147483647

      yes i am storign that value in a int type column.

      Thanks
      faree

      Comment

      • Oli Filth

        #4
        Re: Default 2147483647

        Faree wrote:[color=blue]
        > yes i am storign that value in a int type column.
        >[/color]

        Well that's your problem then.

        If you insert 001234 into an int type, it stores 1234, because that's
        the integer value.

        You'll want to use a character-based type, e.g. VARCHAR(x).

        --
        Oli

        Comment

        • Faree

          #5
          Re: Default 2147483647


          Oli Filth wrote:[color=blue]
          > Faree wrote:[color=green]
          > > yes i am storign that value in a int type column.
          > >[/color]
          >
          > Well that's your problem then.
          >
          > If you insert 001234 into an int type, it stores 1234, because that's
          > the integer value.
          >
          > You'll want to use a character-based type, e.g. VARCHAR(x).
          >
          > --
          > Oli[/color]

          No Oli..

          My problem was when i store actual phone number like 234567
          ...then also it is storign this number.Thanks for the quick reply.

          Regards,
          Faree

          Comment

          • Kim André Akerø

            #6
            Re: Default 2147483647

            Faree wrote:
            [color=blue]
            > Hi all,
            >
            > I am doing portal for storing info of visitors.it is working well
            > too.but my prob is with mysql..when i entered infoa bt thier phone
            > numbers ,fax or mobile numbers,soemtim es it is storing 2147483547
            > instead of given number or default null.can u tell me the reason and
            > solution for it.[/color]

            2147483647 is the maximum value for a signed integer, as per the MySQL
            manual.


            I'd choose a different field type, or at least one that can account for
            larger numbers.

            --
            Kim André Akerø
            - kimandre@NOSPAM betadome.com
            (remove NOSPAM to contact me directly)

            Comment

            • Faree

              #7
              Re: Default 2147483647

              Now my probelm solved.Thnaks for btoh of u Oli and Kim.Thanks for u r
              quick response.

              Regards,

              Faree

              Comment

              • Geoff Berrow

                #8
                Re: Default 2147483647

                A waste of electrons? You decide, but Message-ID:
                <1130245491.083 245.257190@g47g 2000cwa.googleg roups.com> from Oli Filth
                contained the following:
                [color=blue]
                >If you insert 001234 into an int type, it stores 1234, because that's
                >the integer value.
                >
                >You'll want to use a character-based type, e.g. VARCHAR(x).[/color]

                I wish I had a £ for every time a student had made that mistake :-}

                --
                Geoff Berrow (put thecat out to email)
                It's only Usenet, no one dies.
                My opinions, not the committee's, mine.
                Simple RFDs http://www.ckdog.co.uk/rfdmaker/

                Comment

                Working...