Sorting script

Discussion in 'PHP' started by bnazarov, Feb 16, 2007.

  1. #1
    Hi everyone,
    Here is my problem.
    I have a catalogue of products and every week one product is added to the DB. My problem is that i whould like to sort them like i want. Sorting by id, product_name, add_date is not good idea.
    I though about additional number field in witch each time i add a product i put the sorting position of the product but its not a good idea because i have to replace the priority of the older products.

    So does anyone have any idea?
    Tnx in advance and sorry for my english.
     
    bnazarov, Feb 16, 2007 IP
  2. daboss

    daboss Guest

    Messages:
    2,249
    Likes Received:
    151
    Best Answers:
    0
    Trophy Points:
    0
    #2
    wow, i'm totally clueless about what you are asking for when i read your post. what do you want to sort by? why not sort by id, product)name or add_date?
     
    daboss, Feb 16, 2007 IP
  3. designcode

    designcode Well-Known Member

    Messages:
    738
    Likes Received:
    37
    Best Answers:
    0
    Trophy Points:
    118
    #3
    Just add a new field "display_order" and use "order by" in your query.
     
    designcode, Feb 16, 2007 IP