Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> Problem z 1 liniką kodu php..., Proszę o pomoc *Nie znalazłem w google nic*
Klaczus
post
Post #1





Grupa: Zarejestrowani
Postów: 3
Pomógł: 0
Dołączył: 2.10.2011

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


Problem jest taki:

Warning: Division by zero in /home/klaczus/domains/zespoltakt.com/public_html/galeria/index.php on line 131

Co świadczy o dzieleniu przez 0, wyczytałem tak w googlach, ale nie znalazłem rozwiązania dokładnie tego przykładu bo nikt tego problemu jeszcze nie miał.

Kod:

130: echo('</td>');
131: if($counter % get_setting(piccols) == 0){ echo("</tr>\n<tr>"); }
132: $counter++;

Proszę o pomoc.
Go to the top of the page
+Quote Post
cycofiasz
post
Post #2





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

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


Najpierw sprawdzaj czy get_setting(piccols) nie jest czasami równe 0 a dopiero później licz reszte z dzielenia
Go to the top of the page
+Quote Post
Klaczus
post
Post #3





Grupa: Zarejestrowani
Postów: 3
Pomógł: 0
Dołączył: 2.10.2011

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


Mógłby ktoś mi to napisać? :|
Go to the top of the page
+Quote Post
marcinpruciak
post
Post #4





Grupa: Zarejestrowani
Postów: 161
Pomógł: 9
Dołączył: 14.07.2008

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


if(get_setting(piccols) !=0 and $counter % get_setting(piccols) == 0){ echo("</tr>\n<tr>"); }
Go to the top of the page
+Quote Post
Klaczus
post
Post #5





Grupa: Zarejestrowani
Postów: 3
Pomógł: 0
Dołączył: 2.10.2011

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


Problem rozwiązany thx (IMG:style_emoticons/default/biggrin.gif)
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: 22.08.2025 - 21:17