Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [php] pętla i fputs
Baciok
post 12.09.2007, 15:50:08
Post #1





Grupa: Zarejestrowani
Postów: 5
Pomógł: 0
Dołączył: 12.09.2007

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


$nr = 1;
$plik = fopen("zamowienie.txt", "a");

while ($nr <= 5);
{
fputs($plik, "$nr||jakisstring|| \n");

$nr++;

}
fclose($plik);

witam
mam problemik z tym skryptem wyżuca błąd:
Fatal error: Maximum execution time of 120 seconds exceeded

ma ktoś jakiś pomysł? dzięki z góry

Ten post edytował Baciok 12.09.2007, 16:01:10
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 3)
Cysiaczek
post 12.09.2007, 15:56:27
Post #2





Grupa: Moderatorzy
Postów: 4 465
Pomógł: 137
Dołączył: 26.03.2004
Skąd: Gorzów Wlkp.




Popraw proszę tytuł topiku na zgodny z zasadami forum Przedszkole i dodaj bbcode

Czy ten string nie jest generowany dynamicznie? Może łączysz się z innym serwerem i oczekiwanie na niego trwa tak długo?


--------------------
To think for yourself you must question authority and
learn how to put yourself in a state of vulnerable, open-mindedness;
chaotic, confused, vulnerability, to inform yourself.
Think for yourself. Question authority.
Go to the top of the page
+Quote Post
Baciok
post 12.09.2007, 16:08:19
Post #3





Grupa: Zarejestrowani
Postów: 5
Pomógł: 0
Dołączył: 12.09.2007

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


blinksmiley.gif jakisstring wyciąga wartość z $_session['produkt'] , nie łączy się z żadnym serwerem wewnętrznym, błąd wyskakuje w localhost
Go to the top of the page
+Quote Post
Cysiaczek
post 12.09.2007, 16:59:30
Post #4





Grupa: Moderatorzy
Postów: 4 465
Pomógł: 137
Dołączył: 26.03.2004
Skąd: Gorzów Wlkp.




Pętla while jest czasami jakas powalona :|
zamień ją na:
  1. <?php
  2. for($i=0; $i<=5; $i++)
  3. {
  4. //itd
  5. }
  6. ?>


Działa bo 100%

Pozdrawiam.


--------------------
To think for yourself you must question authority and
learn how to put yourself in a state of vulnerable, open-mindedness;
chaotic, confused, vulnerability, to inform yourself.
Think for yourself. Question authority.
Go to the top of the page
+Quote Post

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

 



RSS Wersja Lo-Fi Aktualny czas: 18.07.2025 - 04:39