Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [php] Nie moge odwołać się do funkcji
slawek635
post
Post #1





Grupa: Zarejestrowani
Postów: 26
Pomógł: 0
Dołączył: 8.02.2006

Ostrzeżenie: (10%)
X----


Witam,
  1. <?php
  2.  
  3. class xxx{
  4.  
  5.     var $_recordsCount = 0;
  6.     function setRecordsCount($count)
  7.     {
  8.              $this->_recordsCount = $count;
  9.              print _recordsCount;
  10.              
  11.     }
  12.  
  13. }
  14.  
  15. echo setRecordsCount(500);
  16.  
  17. ?>

poprawiam + warn
---
nospor


Mam taki błąd Fatal error: Call to undefined function setRecordsCount()

O co w tym chodzi ?

Pozdrawiam
Sławomir Gruszka

Ten post edytował nospor 30.03.2006, 15:58:44
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 2)
nospor
post
Post #2





Grupa: Moderatorzy
Postów: 36 557
Pomógł: 6315
Dołączył: 27.12.2004




http://pl.php.net/manual/pl/language.oop.php

ps: widze postępy. aby nie pokazac co to za klasa to juz xxx ją nazwales smile.gif


--------------------

"Myśl, myśl, myśl..." - Kubuś Puchatek || "Manual, manual, manual..." - Kubuś Programista
"Szukaj, szukaj, szukaj..." - Kubuś Odkrywca || "Debuguj, debuguj, debuguj..." - Kubuś Developer

Go to the top of the page
+Quote Post
aj_rudy
post
Post #3





Grupa: Zarejestrowani
Postów: 17
Pomógł: 0
Dołączył: 30.03.2006

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


może tak :

  1. <?php
  2.  
  3. class xxx{
  4.  
  5.     var $_recordsCount = 0;
  6.     function setRecordsCount($count)
  7.     {
  8.              $this->_recordsCount = $count;
  9.              print $this->_recordsCount;
  10.              
  11.     }
  12.  
  13. }
  14.  
  15.  
  16. $nowa = new xxx;
  17. $nowa->setRecordsCount(500);
  18. echo $nowa->_recordsCount;
  19.  
  20. ?>


pozdr.

Ten post edytował aj_rudy 30.03.2006, 17:27:57
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 Aktualny czas: 19.08.2025 - 05:26