Ask a Question related to Dreamweaver AppDev, Design and Development.

  1. #1

    Default Re: reset id

    I can't remember exactly but i think if you check the field and then click on 'operations' you can change the auto-increment there.

    Ross

    Ross Riley Guest

  2. Similar Questions and Discussions

    1. reset password
      I forget my coldfusion server 6.1 administrator password. How can I get into it? Thank you jli@igi-usa.com
    2. CF and IIS Reset Together?
      Wouldn't it be a good idea to restart ColdFusion and reset IIS during a CF outage? This assumes all web sites are CF-based.
    3. Using reset() and mysql_data_seek()
      I was trying to make a page were I have printing out an array of results from a MYSQL query, then for interest, printed out the same results...
    4. How to reset
      I actually posted here before several months ago and got a good solution but I can't remember it or find the old post. Someone here gave...
    5. DFS reset(s)
      I am using a Windows XP Pro computer on a Windows 2000 Active Directory domain. The admin has scripts setup to use 2-mapped drives (J: and K:)that...
  3. #2

    Default Re: reset id

    You could export the data from the table into a file, then export the table
    structure only, deleting the auto increment field at the end of the table
    structure. Use the SQL to recreate the table and then write a script to read
    in the data and insert it back into the file, missing out the auto number
    field, so its inserted automatically.


    --
    Gareth - TMM Dreamweaver
    [url]http://www.dreamweavermxsupport.com/[/url]
    [url]http://www.garethdp.com/[/url]

    PHP Login Suite V2 - 34 Server Behaviors to build a complete Login system.
    [url]http://www.phploginsuite.co.uk/[/url]

    Co-Author: Dreamweaver MX: Instant Troubleshooter - Apress
    Co-Author: Practical Intranet Development - Apress
    Co-Author: Dreamweaver MX: Advanced PHP Web Development - Apress
    Co-Author: Dreamweaver MX: PHP Web Development - Wrox


    gareth Guest

  4. #3

    Default Re: reset id

    Thanks guys,
    tried the first but no luck......now working on gareths idea


    "gareth" <gareth@buzzinet.co.uk> wrote in message
    news:cuu08h$jbg$1@forums.macromedia.com...
    : You could export the data from the table into a file, then export the
    table
    : structure only, deleting the auto increment field at the end of the table
    : structure. Use the SQL to recreate the table and then write a script to
    read
    : in the data and insert it back into the file, missing out the auto number
    : field, so its inserted automatically.
    :
    :
    : --
    : Gareth - TMM Dreamweaver
    : [url]http://www.dreamweavermxsupport.com/[/url]
    : [url]http://www.garethdp.com/[/url]
    :
    : PHP Login Suite V2 - 34 Server Behaviors to build a complete Login system.
    : [url]http://www.phploginsuite.co.uk/[/url]
    :
    : Co-Author: Dreamweaver MX: Instant Troubleshooter - Apress
    : Co-Author: Practical Intranet Development - Apress
    : Co-Author: Dreamweaver MX: Advanced PHP Web Development - Apress
    : Co-Author: Dreamweaver MX: PHP Web Development - Wrox
    :
    :


    lawrie Guest

  5. #4

    Default Re: reset id

    .oO(lawrie)
    >I am using phpmyadmin with a mysql database.
    >
    >I have set the primary key ( a numerical value) to increase incrementally.
    >
    >After some time the range of id's become spread out.
    Nothing special.
    >Can the key be recalibrated back to 1,2,3......etc.
    Why?
    >I ask this as a client wants to reorder images and I am trying to change the
    >CM to accomodate this. It would help if the id's were all within a
    >managable range.
    Usually a primary key is written one time and then never touched again.
    Why should it be necessary to rearrange the records? They are still in
    order, even if some IDs are missing. If you have to recreate the primary
    keys then IMHO there's something wrong.

    Micha
    Michael Fesser Guest

  6. #5

    Default Re: reset id


    "Michael Fesser" <netizen@gmx.net> wrote in message
    news:bhu611h9c492pp89dilp3eeb55qfjmiont@4ax.com...
    : .oO(lawrie)
    :
    : >I am using phpmyadmin with a mysql database.
    : >
    : >I have set the primary key ( a numerical value) to increase
    incrementally.
    : >
    : >After some time the range of id's become spread out.
    :
    : Nothing special.
    :
    : >Can the key be recalibrated back to 1,2,3......etc.
    :
    : Why?
    :
    : >I ask this as a client wants to reorder images and I am trying to change
    the
    : >CM to accomodate this. It would help if the id's were all within a
    : >managable range.
    :
    : Usually a primary key is written one time and then never touched again.
    : Why should it be necessary to rearrange the records? They are still in
    : order, even if some IDs are missing. If you have to recreate the primary
    : keys then IMHO there's something wrong.

    Yes, well I guess something is wrong.
    The client has two pages of jewellery products that are drawn from a
    database she manages.
    No problem. She uploads images & info from a simple admin I have set up.
    She now thinks, rightly, that if she creates a piece a pendant which
    complements some earrings then it would be good if this new piece 'p' could
    follow the existing piece 'e' in the gallery.
    I can order the products by date or id or ....but I cannot think of a way
    for her to get 'f' next to 'b'.
    I thought that if I could rationalise the primary key then I could create
    something around that.
    As you say, that is probably hamfisted.
    Appreciate it if you can point the way


    lawrie Guest

  7. #6

    Default Re: reset id

    I'd set up a new column and set your sort order explicitly. Then you can do
    whatever you want to it. :)

    Example:
    Insert a new item at position 6:

    UPDATE Products
    SET SortOrder = SortOrder + 1
    WHERE SortOrder >= 6

    INSERT INTO Products(Name, Description, Price, SortOrder)
    VALUES('Pendant','Lorem ipsum dolor sit amet...',500.00,6)

    Not exactly elegant, but at least manageable as long as there aren't new
    products being added second by second.

    "lawrie" <lawrie@nomailspamoranything.net> wrote in message
    news:cv040h$pl6$1@forums.macromedia.com...
    >
    > "Michael Fesser" <netizen@gmx.net> wrote in message
    > news:bhu611h9c492pp89dilp3eeb55qfjmiont@4ax.com...
    > : .oO(lawrie)
    > :
    > : >I am using phpmyadmin with a mysql database.
    > : >
    > : >I have set the primary key ( a numerical value) to increase
    > incrementally.
    > : >
    > : >After some time the range of id's become spread out.
    > :
    > : Nothing special.
    > :
    > : >Can the key be recalibrated back to 1,2,3......etc.
    > :
    > : Why?
    > :
    > : >I ask this as a client wants to reorder images and I am trying to
    change
    > the
    > : >CM to accomodate this. It would help if the id's were all within a
    > : >managable range.
    > :
    > : Usually a primary key is written one time and then never touched again.
    > : Why should it be necessary to rearrange the records? They are still in
    > : order, even if some IDs are missing. If you have to recreate the primary
    > : keys then IMHO there's something wrong.
    >
    > Yes, well I guess something is wrong.
    > The client has two pages of jewellery products that are drawn from a
    > database she manages.
    > No problem. She uploads images & info from a simple admin I have set up.
    > She now thinks, rightly, that if she creates a piece a pendant which
    > complements some earrings then it would be good if this new piece 'p'
    could
    > follow the existing piece 'e' in the gallery.
    > I can order the products by date or id or ....but I cannot think of a way
    > for her to get 'f' next to 'b'.
    > I thought that if I could rationalise the primary key then I could create
    > something around that.
    > As you say, that is probably hamfisted.
    > Appreciate it if you can point the way
    >
    >

    CMBergin Guest

  8. #7

    Default Re: reset id


    "CMBergin"wrote : I'd set up a new column and set your sort order
    explicitly. Then you can do
    : whatever you want to it. :)
    :
    : Example:
    : Insert a new item at position 6:
    :
    : UPDATE Products
    : SET SortOrder = SortOrder + 1
    : WHERE SortOrder >= 6
    :
    : INSERT INTO Products(Name, Description, Price, SortOrder)
    : VALUES('Pendant','Lorem ipsum dolor sit amet...',500.00,6)
    :
    : Not exactly elegant, but at least manageable as long as there aren't new
    : products being added second by second.

    Neat! :)

    thanks

    lawrie


    lawrie Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139