Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP]Klasy w php.
IdeaProgram
post
Post #1





Grupa: Zarejestrowani
Postów: 18
Pomógł: 0
Dołączył: 3.03.2016

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


Witam, posiadam dwie klasy, DB i Player, w player w konstrukcie zrobilem laczenie z DB. W funkcji getPlayer w Player mam dane o uzytkowniku np. $this->id = $array['id']; teraz gdy zrobilem nowa funkcje pod funkcja getPlayer w tej samej klasie gdy odwoluje sie do id czyli $this->id nie pobiera mi juz tego id. Czy musze robic jakas specjalna publiczna funkcje lub cos innego abym mogl z tego korzystac?
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
IdeaProgram
post
Post #2





Grupa: Zarejestrowani
Postów: 18
Pomógł: 0
Dołączył: 3.03.2016

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


Dobra już zrozumiałem, końcowo funkcja query wygląda tak:

  1. public function query($q)
  2. {
  3.  
  4. if($this->query = $this->db->query($q)) {
  5.  
  6. $results = $this->query;
  7.  
  8. return $results;
  9.  
  10. }
  11.  
  12. }



Ten post edytował IdeaProgram 6.03.2016, 13:33:42
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: 11.10.2025 - 21:20