using array in php

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • I_love_php

    using array in php

    im working in an online game project using php . with 9000 users as
    start who register so far


    anyway to make some reports about the users (example best users with
    higest points ... worrest users with low points and so on) one of
    co-workers with me suggest to use array insted of store the data in the

    database everytime user do an action .


    the idea is when a user was to see any reports the users ID will store
    in an array and will calculate the points and store them in this array
    (users id is the key for this array) .. then sort this array the way we

    want and list it


    i like the idea but i think about the loading what if there is million
    user for example should it be problem ??


    im new in php that why i ask this


    thanks in advance

  • ZeldorBlat

    #2
    Re: using array in php

    Where do you plan to keep the array? The data that goes into your
    array needs to be stored somewhere...pro bably in a database.

    Comment

    • I_love_php

      #3
      Re: using array in php

      during a run time it creat an array to do the job

      Comment

      • ZeldorBlat

        #4
        Re: using array in php

        Sure...you can put anything into an array at run time. But where are
        you storing how many points each user has? When you update how many
        points a user has, where are you recording that?

        Comment

        • I_love_php

          #5
          Re: using array in php

          during run time te system take the points from the database and
          caculate them then store them in array and sort them

          Comment

          • ZeldorBlat

            #6
            Re: using array in php

            So if they're already in the database, why not just sort them there?

            Comment

            • I_love_php

              #7
              Re: using array in php

              it is not just sort i take the data from the database and use these
              data to calculate points first i have to count the odds then points

              it cant be from the database

              Comment

              • JDS

                #8
                Re: using array in php

                On Mon, 11 Jul 2005 07:12:06 -0700, I_love_php wrote:
                [color=blue]
                > i like the idea but i think about the loading what if there is million
                > user for example should it be problem ??[/color]

                Well, if not an array, what else are you going to use? If there are a
                million users then there might be a problem no matter what you use.

                Your question is a bit too nebulous to answer, frankly. Do you have more
                specific details?

                --
                JDS | jeffrey@example .invalid
                | http://www.newtnotes.com
                DJMBS | http://newtnotes.com/doctor-jeff-master-brainsurgeon/

                Comment

                Working...