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. ?>
(IMG:http://forum.php.pl/uwaga.gif)
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
aj_rudy
post
Post #2





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

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: 8.10.2025 - 11:12