Jump to content

Recommended Posts

Ok, I have already asked this question about a month ago but didnt really get an answer, I dont think i explained well enough so here goes

 

I have a whosonline page which displays members online.

 

Lets says there are 500 members online and I display 10 per page.

 

So, the first page displays 10 members currently online, I click next page and I get the next 10 and so on

 

Now, I am on page 3, I go away for 5 minutes and come back to the computer. By then 100 people have went offline therefor the order I was displaying by has rejuggled. here is an example

 

At 5.30PM

1

2

3

4

5

6

7

8

9

10

 

At 5:35pm 3 members 3,7,9 have went off line, meaning this

1

2

 

4

5

6

 

8

 

10

 

Which then becomes this to meet the requirments of LIMIT 0,10

1 // #1

2 // #2

4 // #3

5 // #4

6 // #5

8 // #6

10 // #7

11 // #8

12 // #9

13 // #10

 

My problem is, if I click next/back I sometimes get a few people on that page that where on the other page beucase people have dropped offline thus they take there place to fill the gaps

 

I cant think of how I can overcome this? It seems quite simple but in practice.. a real pain!!

 

I hope I have explained the problem well enough, any ideas to prevent this. What is the the standard way to display member online times which allow consistancy

Link to comment
https://forums.phpfreaks.com/topic/88069-whos-online/
Share on other sites

pagination scripts that pull off mysql shouldn't have predefined limits, they should be defined at the time the page loads

 

I.e You carry across the page number and number of results per page instead of results 20-30

 

Example

 

http://www.mysite.com/page.php?start=20&end=30    (This is bad coding for pagination)

 

http://www.mysite.com/page.php?page=2&resutls_per_page = 10 (This is much better)

 

it be adventaous to see your script to see how to help this, but I see it must be some big secret

Link to comment
https://forums.phpfreaks.com/topic/88069-whos-online/#findComment-454810
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.