|
Posted by Schraalhans Keukenmeester on 05/03/07 07:20
On Wed, 02 May 2007 15:22:46 -0700, dawnerd wrote:
> On May 2, 3:11 pm, dawnerd <dawn...@gmail.com> wrote:
>> I am having troubles with my script. It is supposed to generate a
>> "map" from a serialized array stored in a database. However, it is not
>> generating any html. I know the data is being retrieved from the
>> database and being unserialized properly as I've tested that. It seems
>> to not go through the loop.
>>
>> while( $x > $maxx )
>> {
>> $this->outputHTML .= "<span class=\"cityMapBlock\"><a href=\"#\"
>> title=\"" . $mapArray[$x][$y]['type'] . "\">" . $mapArray[$x][$y]
>> ['type'] . "</a></span>";
>>
>> if( $mapArray[$x][$y] == $maxy )
>> {
>> $this->outputHTML .= "</br>";
>> $y = $maxy - 10;
>> $x--;
>> }
>> }
>>
>> return true;
You have included the $x decrement in the if-clause, so unless you get
there right away you keep adding the same line to your $html over and
over, which, as the error told you, ends as soon as the variable has eaten
all of your available memory (default is 8 megs I believe).
Outside the if {...} $x should get a new value.
HTH
Sh.
[Back to original message]
|