Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Oct 2002
    Posts
    95
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Changing the order of rows in a DB with Classic ASP

    Im just wondering if theres a good way to like....move a certain row up or down in a database with ASP...

    basically, waht i have is a news section on a page, but i'd like to give the admin the ability to change the order that the stories appear in...so like the top story would be "number 1" and then "#2" and so on and soforth...

    just wondering if anyones seen anything that will allow me to give him the ability to bump "#4" up to "#1" ...etc...what would this involve?

    if any of you are a member of Netflix....i got this idea from the Queue in Netflix....the way you can set the order of your items...

    does this sound possible at all?

    thanks!
    kasey aka robocop

  • #2
    Senior Coder Spudhead's Avatar
    Join Date
    Jun 2002
    Location
    London, UK
    Posts
    1,856
    Thanks
    8
    Thanked 110 Times in 109 Posts
    I think that the more common way of doing this is not to alter the ordering of the data within the database, but to add a field that carries an "order" weighting. So you'd have something like:

    SELECT * FROM news WHERE category='sports' ORDER BY orderField

    and your admin section could allow people to change the ordering numbers; they don't even have to be consecutive or anything.

  • #3
    New Coder
    Join Date
    Oct 2002
    Posts
    95
    Thanks
    0
    Thanked 0 Times in 0 Posts
    what do you mean by "they dont have to be consecutive"...like i could have "1, 4, 5, 32, 42..." ?

    anyone seen any scripts out there to do this?

    thanks a million!


  •  

    Posting Permissions

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