#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2011
    Posts
    11
    Rep Power
    0

    Image show with priority


    I want to build a image show script, but, i want to give priority to the images.

    Lets say i have 10 images in my table and 3 have priority 10 and the rest 5, i want to display the images with priority 10 more often than the images with prio 5.

    I already have a random rotate script, but in this script i cant set priority.

    Anybody got a clue on how to start ? Or maybe a link to a script that already does this ?

    Kind regards !
  2. #2
  3. No Profile Picture
    Moderator

    Join Date
    Jun 2002
    Location
    Raleigh, NC
    Posts
    5,265
    Rep Power
    968
    It sounds like you need to add a priority column to your table and then query just for the images that have priority, or query for them all but sort them with ORDER BY so priority images are at the top of your results.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2011
    Posts
    11
    Rep Power
    0
    yes, indeed, that is 1 way, but, i need to display all 10 images in a sort of rotate system. I want to show them one by one, with another image on refresh and show the ones with a higher priority more than the ones with a lower priority.
  6. #4
  7. No Profile Picture
    Moderator

    Join Date
    Jun 2002
    Location
    Raleigh, NC
    Posts
    5,265
    Rep Power
    968
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2011
    Posts
    11
    Rep Power
    0
    thank you for the fast response.. gonna look into this !!

    Thank you !
  10. #6
  11. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2011
    Posts
    11
    Rep Power
    0
    that is what i need, but just in CF
  12. #7
  13. No Profile Picture
    Moderator

    Join Date
    Jun 2002
    Location
    Raleigh, NC
    Posts
    5,265
    Rep Power
    968
    That SQL should work with anything (CF or not).
  14. #8
  15. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2011
    Posts
    11
    Rep Power
    0
    On the page they speak of running mysql or mssql. At the moment im just using an access db. But this code should work ?? Gonna try that tomorrow..

    Thnx !
  16. #9
  17. No Profile Picture
    Moderator

    Join Date
    Jun 2002
    Location
    Raleigh, NC
    Posts
    5,265
    Rep Power
    968
    I really have no idea if it will work in Access because I never use Access. Partly because it is slow, and partly because you can never be sure if it will support standard ASNI SQL which runs on all of the other databases (like MySQL, Oracle, etc.).
  18. #10
  19. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2011
    Posts
    11
    Rep Power
    0
    you cant use the NEWID() in Access, so i still need to find a way around this..
  20. #11
  21. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2011
    Posts
    11
    Rep Power
    0
    got a solution for this problem.

    its answered on another website, no clue if i can give a link but here it is:

    http://stackoverflow.com/questions/6151852/access-db-select-one-row-randomly-but-taking-into-account-a-weight

IMN logo majestic logo threadwatch logo seochat tools logo