Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Podstawa podstaw a jednak :), Problem z dzieleniem...
thornag
post
Post #1





Grupa: Zarejestrowani
Postów: 504
Pomógł: 2
Dołączył: 31.03.2006
Skąd: Londyn

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


Witam dosc krotkie i proste pytanie.

Dlaczego ponizsze wyrazenie nie zwraca wyniku ?
  1. <?php
  2. $this->rate = $this->rankArray[item_rate] / $this->rankArray[item_rates];
  3. ?>


Probowalem z doubleval itp itp i nadal nic. Gdzie jest blad ?

Ten post edytował thornag 7.07.2006, 11:41:20
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
thornag
post
Post #2





Grupa: Zarejestrowani
Postów: 504
Pomógł: 2
Dołączył: 31.03.2006
Skąd: Londyn

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


Przy wklejaniu kodu zauwazylem blad (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)
  1. <?php
  2. case "item":
  3. $this->query("SELECT item_rate, item_rates FROM casts WHERE item_id = '$this->id'");
  4. $this->rankArray = mysql_fetch_array($this->result);
  5. break;
  6. if ($this->rankArray[item_rates] == 0) {
  7. $this->rate = 0;
  8. } else {
  9.  
  10. $this->rate = $this->rankArray['item_rate'] / $this->rankArray['item_rates'];
  11. }
  12. echo "2dupa";
  13. break;
  14. return $this->rate;
  15. }
  16. ?>


Wkradl mi sie break; (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)

@mike_mech -> wiem co chcesz napisac... szukajcie bledow (IMG:http://forum.php.pl/style_emoticons/default/smile.gif) Tylko ze ja ich szukalem wyswietlalem wyniki itp (IMG:http://forum.php.pl/style_emoticons/default/tongue.gif) a break mi po prostu umknal (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)

Ten post edytował thornag 7.07.2006, 12:34:23
Go to the top of the page
+Quote Post

Posty w temacie


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: 12.10.2025 - 11:48