phpMyAdmin question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • JMosey@gmail.com

    phpMyAdmin question

    I know this isn't strictly php, but I am guessing someone has run into
    this before in php work.

    I have a table, this table has an autonumber as a primary key.

    I export the table in phpMyAdmin.

    Cool so far.

    I create a new DB, I import the backup of the DB in that new DB and it
    throws an error that the table with the automnumber already has a value
    of 1 (it isn't incrementing the new table).

    Ok, go back and hack through, remove the autonumber. Now export and it
    imports fine.

    Except how do I get the autonumber back? There are hundreds of rows of
    data and I want that autonumber but when I try and add it it says there
    is already an ID field with a "1" (same as before, not saying "find the
    highest and add one more" just saying "start at 1, oops there is one,
    then die"

    Anyone know a way around this? I want ot add my autonumber to my table
    with the data that is already there.

  • chonny

    #2
    Re: phpMyAdmin question

    I have same problem! :(

    Comment

    • Rik

      #3
      Re: phpMyAdmin question

      JMosey@gmail.co m wrote:[color=blue]
      > I know this isn't strictly php, but I am guessing someone has run into
      > this before in php work.
      >
      > I have a table, this table has an autonumber as a primary key.
      >
      > I export the table in phpMyAdmin.
      >
      > Cool so far.
      >
      > I create a new DB, I import the backup of the DB in that new DB and it
      > throws an error that the table with the automnumber already has a
      > value of 1 (it isn't incrementing the new table).
      >
      > Ok, go back and hack through, remove the autonumber. Now export and it
      > imports fine.
      >
      > Except how do I get the autonumber back? There are hundreds of rows of
      > data and I want that autonumber but when I try and add it it says
      > there is already an ID field with a "1" (same as before, not saying
      > "find the highest and add one more" just saying "start at 1, oops
      > there is one, then die"
      >
      > Anyone know a way around this? I want ot add my autonumber to my table
      > with the data that is already there.[/color]


      This what you mean?

      Export options:
      - structure
      - Add AUTO_INCREMENT
      - data
      - Complete inserts

      Grtz,
      --
      Rik Wasmus


      Comment

      • Jerry Stuckle

        #4
        Re: phpMyAdmin question

        JMosey@gmail.co m wrote:[color=blue]
        > I know this isn't strictly php, but I am guessing someone has run into
        > this before in php work.
        >
        > I have a table, this table has an autonumber as a primary key.
        >
        > I export the table in phpMyAdmin.
        >
        > Cool so far.
        >
        > I create a new DB, I import the backup of the DB in that new DB and it
        > throws an error that the table with the automnumber already has a value
        > of 1 (it isn't incrementing the new table).
        >
        > Ok, go back and hack through, remove the autonumber. Now export and it
        > imports fine.
        >
        > Except how do I get the autonumber back? There are hundreds of rows of
        > data and I want that autonumber but when I try and add it it says there
        > is already an ID field with a "1" (same as before, not saying "find the
        > highest and add one more" just saying "start at 1, oops there is one,
        > then die"
        >
        > Anyone know a way around this? I want ot add my autonumber to my table
        > with the data that is already there.
        >[/color]

        Maybe ask in a mysql newsgroup, such as comp.databases. mysql?

        --
        =============== ===
        Remove the "x" from my email address
        Jerry Stuckle
        JDS Computer Training Corp.
        jstucklex@attgl obal.net
        =============== ===

        Comment

        • JMosey@gmail.com

          #5
          Re: phpMyAdmin question

          The question now is two things (probably the same answer).

          1. The table I had to take the autonumber off, it won't let me put it
          back on "Duplicate entry '1' for key 1" How do I tell it, "keep the
          autoIDs that are set, and when someone adds a new one then autonumber"
          because right now it is trying to renumber where there is already data.


          2. Same thing with the copy of the table, it won't let me add the key
          there either.

          Comment

          Working...