A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Repeating Script....is it realistic online?

  1. #1
    Junior Member
    Join Date
    Nov 2005
    Posts
    29

    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?

  2. #2
    Junior Member
    Join Date
    Nov 2005
    Posts
    29
    The aim is to show a continuously updating list of members online using the site.

    Thanks for any response.

  3. #3
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    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

  4. #4
    Registered User
    Join Date
    Feb 2001
    Posts
    13,041
    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
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center