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
viking
post
Post #2





Grupa: Zarejestrowani
Postów: 6 381
Pomógł: 1116
Dołączył: 30.08.2006

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


Pod $this->db->db->query jest natywna metoda http://php.net/manual/pl/mysqli.query.php ale ty ją definiujesz w klasie DB. connect() większego sensu nie ma bo robisz to samo w konstruktorze.
var_dump($user);

Ten post edytował viking 6.03.2016, 13:14:48
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: 15.10.2025 - 01:59