-
Repeating Script....is it realistic online?
I have implemented a script on a flash site I am developing which calls a php script to check the database for a field in a table that is called "status"....this is a value of either 1 or 0, 0 being offline and 1 being online.
If the value of status is 1 it shows the names of all members with records in database that are online (when a user logs on a flash script via php updates their record status to 1 and when they log out it sets it to 0).
Basically this is done by a script continuously calling a php script checking all the records with a
$query = "SELECT * FROM customers WHERE online = 1 ORDER BY ID DESC";
This script is being called all the time because a movie clip continuously looping with 3 frames processes this and updates the members online list.
What I want to know is, is this realistic and efficient in an online environment.
With the php script called all the time, is it going to slow things down or take a lot of bandwidth, cause me any problems with server or anything when other php scripts are running alongside it.
If so is there any better way to do it?
-
The aim is to show a continuously updating list of members online using the site.
Thanks for any response.
-
FK'n_dog
looping with 3 frames in a movie setting of for example 30 frames per second
will call the server script 10 times every second !! eek !!
try expanding the loop to call every 5 to 10 seconds
-
Hi,
I would guess that calling the server every 10 or 20 seconds is accurate enough for what you want to do.
You should somehow handle the case where visitors simply disappear without logging out (a common practice in html websites is to consider a vistor offline who has not clicked anything for several minutes)
Musicman
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|