Array Maximum Size

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • phpgeek79
    New Member
    • Nov 2007
    • 2

    #1

    Array Maximum Size

    Hi, I created a scripts that will hold an array with a values came from database.
    My total rows have reached up to more than 50 thousands of records.
    So my array length have reached that size.
    The problem is when am trying to get the last value of this array, it returns me a null value or empty.
    Can somebody tell me if there is a maximum limit the array can hold?
  • Atli
    Recognized Expert Expert
    • Nov 2006
    • 5062

    #2
    Hi. Welcome to TSDN!

    I don't think there is a limit on how big an array can be, but there is a limit on how much memory your script can use.

    The 'memory_limit' directive in the php.ini configuration file holds the max amount of memory your scripts can consume. Try changing this, see if that helps.

    Comment

    • pbmods
      Recognized Expert Expert
      • Apr 2007
      • 5821

      #3
      Heya, PHP Geek.

      I'd recommend rethinking your process design. Consider fetching the data in blocks of 1000 (or less). If you're processing the data, consider doing as much of your processing on the MySQL side as you can or re-organize your data and/or index your calculations to make such processing easier.

      Comment

      • phpgeek79
        New Member
        • Nov 2007
        • 2

        #4
        Thnx for all your post dudes...
        My pleasure I've got some ideas from you.
        Hope to hear yah again...

        Comment

        Working...