Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Problem z pamięcią
tabbi
post
Post #1





Grupa: Zarejestrowani
Postów: 150
Pomógł: 3
Dołączył: 30.10.2010

Ostrzeżenie: (0%)
-----


Mam kod:

  1. $result = mysql_query("SELECT * FROM ".$this->sqlTable2." WHERE active=1");
  2. $pbList = array();
  3. $programInfo = mysql_fetch_array($result);
  4. while($programInfo)
  5. {
  6. $name=$programInfo['name'];
  7.  
  8. $programInfo['PureName'] = $this->getPureName($name); // LINIJKA Z BLEDEM
  9. $programInfo['Version'] = $this->getVersionNumber($programInfo['name']); // ANALOGICZNIE TUTAJ tak samo bedzie
  10.  
  11. $pbList[] = $programInfo;
  12. }
  13.  
  14. function getPureName($name)
  15. {
  16. $regex = "#(.*) [0-9]+\.#";
  17. preg_match($regex, $name, $pureName);
  18. if($pureName[1] == "")
  19. {
  20. $regex = "#(.*) [0-9]+#";
  21. preg_match($regex, $name, $pureName);
  22.  
  23. if($pureName[1] == "")
  24. $pureName[1] = $name;
  25. }
  26. return $pureName[1];
  27. }


getVersionNumber jest podobną metodą i wywala mi błąd:

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 80 bytes) in /var/www/vhosts/xxx.pl/httpdocs/atest/a.class.php on line 226

Na lokalu działa ale na serwerze niestety nie ? jakoś poradzicie jak można to naprawić zooptymalizować ?
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 1)
cycofiasz
post
Post #2





Grupa: Zarejestrowani
Postów: 711
Pomógł: 127
Dołączył: 5.07.2008
Skąd: Łódź

Ostrzeżenie: (0%)
-----


  1. $programInfo = mysql_fetch_array($result);
  2. while($programInfo)


Czyżby nieskończona pętelka?
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 23.08.2025 - 03:46