Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6319875
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T15:52:39+00:00 2026-05-24T15:52:39+00:00

How can I rotate select by a given number. I want to rotate select

  • 0

How can I rotate select by a given number.

I want to rotate select items in each visit of a visitor.

On first visit, the newest item is displayed.

On second visit, the second newest come first and the newest goes to the last page, last item.

On third visit, the third come first and the second goes to last page, last item just after newest.

I capture the visit count with a cookie on the first page.

But how can I select circularly?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T15:52:40+00:00Added an answer on May 24, 2026 at 3:52 pm
    1. Either you load the complete resultset into an array and output appropriately, or
    2. you issue two queries:
      • one for n till the end (LIMIT n+1, 100000000 will do in most cases) and
      • one for 1 till n (LIMIT n).

    e.g. this way:

    (SELECT foo FROM bar ORDER BY whatever LIMIT $n+1, 1000000) UNION ALL
    (SELECT foo FROM bar ORDER BY whatever LIMIT $n)
    

    with $n being the visit count excluding the current visit.

    EDIT: As @ypercube pointed out, not only the UNION ALL is necessary, but the order of the result COULD be mixed up anyway. So it is better to issue two queries – which should be no problem, as the additional complexity in code is just marginal if you use a loop.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can I rotate an Bitmap a given number of degrees while maintaining the
I currently can rotate around a pivot point by first translating to the pivot
I want to have one picture in my application that I can rotate to
I want put CSS generated content in select box, and rotate it with CSS.
I have 3 thumbnails which i want to rotate each time a user refresh
I have a database of 3D models. I want user can rotate the model
I am trying to change my Sprite anchor point so that I can rotate
i have following code for moving 4 picture around circular way,but it can rotate
I have a problem with rotating. I know that I can rotate a Texture2D
How can I rotate the text within an HSSFCell class of Apache POI?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.