SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Thread: Mysql

  1. #1
    SitePoint Enthusiast
    Join Date
    May 2003
    Location
    Norway
    Posts
    47
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Mysql

    How can I change the value of a post in my sql.

    I want to change ID=1 to ID=2(over 100 posts in the table)

    Is there an easy way to do this?

  2. #2
    SitePoint Wizard Chris82's Avatar
    Join Date
    Mar 2002
    Location
    Osnabrück
    Posts
    1,003
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi.

    Do you want always increase the id value by one?

    If so try:

    Code:
    UPDATE yourtable SET id = id + 1;

  3. #3
    SitePoint Enthusiast
    Join Date
    May 2003
    Location
    Norway
    Posts
    47
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What i really want is to find a way to insert the same posts with a new ID,to save time.

    I need to insert the same posts with a new ID about 10 or 11 times..

  4. #4
    SitePoint Wizard Chris82's Avatar
    Join Date
    Mar 2002
    Location
    Osnabrück
    Posts
    1,003
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You could use an auto_increment field for the id. This would create a new id for each entry.

  5. #5
    SitePoint Enthusiast
    Join Date
    May 2003
    Location
    Norway
    Posts
    47
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hmm....i'll try..but i'm not sure excactly how

  6. #6
    SitePoint Enthusiast
    Join Date
    May 2003
    Location
    Norway
    Posts
    47
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have ca. 100 posts that have ID=1,and I need the same posts with ID=2,3,4..and so on..


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
  •