INSERT error

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

    INSERT error

    Hi all,

    I have a table containing an ID (unique, autoincrement) and some other
    fields including IP. When I try to insert the 'ip' I get a "Duplicate entry
    for key 1" error (using INSERT INTO tblip (ip) VALUES ('$REMOTE_ADDR
    $_agent') ).
    This table is needed to handle the amount of online users. The strange thing
    is that this happens only with a minority of users. All other users of the
    webiste have reported no problem whatsoever.

    Someone has an idea whats going wrong here

    kind regards
    Stijn


  • RG

    #2
    Re: INSERT error


    "Stijn Goris" <mepisto@hotmai l.com> wrote in message
    news:3f78316e$0 $24155$ba620e4c @reader0.news.s kynet.be...[color=blue]
    > Hi all,
    >
    > I have a table containing an ID (unique, autoincrement) and some other
    > fields including IP. When I try to insert the 'ip' I get a "Duplicate[/color]
    entry[color=blue]
    > for key 1" error (using INSERT INTO tblip (ip) VALUES ('$REMOTE_ADDR
    > $_agent') ).
    > This table is needed to handle the amount of online users. The strange[/color]
    thing[color=blue]
    > is that this happens only with a minority of users. All other users of the
    > webiste have reported no problem whatsoever.
    >
    > Someone has an idea whats going wrong here
    >
    > kind regards
    > Stijn
    >
    >[/color]

    You may have the IP field set to unique.
    This would explain what is happening.
    Have a look
    RG



    Comment

    • Stijn Goris

      #3
      Re: INSERT error


      "RG" <Me@NotTellingY a.com> wrote in message
      news:3f784516$0 $65581$65c69314 @mercury.nildra m.net...[color=blue]
      >
      > "Stijn Goris" <mepisto@hotmai l.com> wrote in message
      > news:3f78316e$0 $24155$ba620e4c @reader0.news.s kynet.be...[color=green]
      > > Hi all,
      > >
      > > I have a table containing an ID (unique, autoincrement) and some other
      > > fields including IP. When I try to insert the 'ip' I get a "Duplicate[/color]
      > entry[color=green]
      > > for key 1" error (using INSERT INTO tblip (ip) VALUES ('$REMOTE_ADDR
      > > $_agent') ).
      > > This table is needed to handle the amount of online users. The strange[/color]
      > thing[color=green]
      > > is that this happens only with a minority of users. All other users of[/color][/color]
      the[color=blue][color=green]
      > > webiste have reported no problem whatsoever.
      > >
      > > Someone has an idea whats going wrong here
      > >
      > > kind regards
      > > Stijn
      > >
      > >[/color]
      >
      > You may have the IP field set to unique.
      > This would explain what is happening.
      > Have a look
      > RG
      >
      >
      >[/color]

      The field ip is not set to unique...


      Comment

      • RG

        #4
        Re: INSERT error


        "Stijn Goris" <mepisto@hotmai l.com> wrote in message
        news:3f78486d$0 $31734$ba620e4c @reader1.news.s kynet.be...[color=blue]
        >
        > "RG" <Me@NotTellingY a.com> wrote in message
        > news:3f784516$0 $65581$65c69314 @mercury.nildra m.net...[color=green]
        > >
        > > "Stijn Goris" <mepisto@hotmai l.com> wrote in message
        > > news:3f78316e$0 $24155$ba620e4c @reader0.news.s kynet.be...[color=darkred]
        > > > Hi all,
        > > >
        > > > I have a table containing an ID (unique, autoincrement) and some other
        > > > fields including IP. When I try to insert the 'ip' I get a "Duplicate[/color]
        > > entry[color=darkred]
        > > > for key 1" error (using INSERT INTO tblip (ip) VALUES ('$REMOTE_ADDR
        > > > $_agent') ).
        > > > This table is needed to handle the amount of online users. The strange[/color]
        > > thing[color=darkred]
        > > > is that this happens only with a minority of users. All other users of[/color][/color]
        > the[color=green][color=darkred]
        > > > webiste have reported no problem whatsoever.
        > > >
        > > > Someone has an idea whats going wrong here
        > > >
        > > > kind regards
        > > > Stijn
        > > >
        > > >[/color]
        > >
        > > You may have the IP field set to unique.
        > > This would explain what is happening.
        > > Have a look
        > > RG
        > >
        > >
        > >[/color]
        >
        > The field ip is not set to unique...
        >
        >[/color]

        Oh well. It's not that then :)
        RG


        Comment

        • Matthias Esken

          #5
          Re: INSERT error

          "Stijn Goris" <mepisto@hotmai l.com> schrieb:
          [color=blue]
          > INSERT INTO tblip (ip) VALUES ('$REMOTE_ADDR $_agent')[/color]

          Please give us your table definition.

          Regards,
          Matthias

          Comment

          • Jeffrey Silverman

            #6
            Re: INSERT error

            On Mon, 29 Sep 2003 17:14:06 +0200, Stijn Goris wrote:

            <snip!>[color=blue]
            > The field ip is not set to unique...[/color]

            It must be either unique or primary key. That is what the reported error
            means.

            need....more... ..information.. ...
            --
            Jeffrey D. Silverman | jeffrey AT jhu DOT edu
            Johns Hopkins University | Baltimore, MD
            Website | http://www.wse.jhu.edu/newtnotes/

            Comment

            Working...