SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Thread: duplicate entry

  1. #1
    SitePoint Guru
    Join Date
    Apr 2001
    Location
    BC, Canada
    Posts
    630
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    duplicate entry

    for some reasson my when ever I try to add something new to my database I get the warning

    Duplicate entry '127' for key 1

    Here is my code:
    PHP Code:

    while (!feof($fp))
    {
        
    $fp2 fgetcsv($fp200"\t");
        
    $id++;
        
    $result mysql_query("INSERT INTO members VALUES ($id, '$email', '$phone', '$city', '$industry', '$name','1')")
            or die (
    mysql_error());

    There are a good 500 rows of info in the file Im reading from... For some reasson its only going to 127?

  2. #2
    SitePoint Addict manipura's Avatar
    Join Date
    Apr 2001
    Location
    Calgary,AB
    Posts
    345
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What field type is your id? If its tinyint thats your problem, I went through the same thing and it only took me 13 hours to figure it out

  3. #3
    SitePoint Guru
    Join Date
    Apr 2001
    Location
    BC, Canada
    Posts
    630
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    its tinyint

    what do I change it to?

  4. #4
    SitePoint Addict zoordaan's Avatar
    Join Date
    Feb 2001
    Location
    NYC/Texas
    Posts
    348
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I usually use an unsigned integer - INT


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •