![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 250 Pomógł: 1 Dołączył: 6.08.2012 Ostrzeżenie: (0%) ![]() ![]() |
Cześć,
próbuję zrozumieć co jest źle w poniższym kodzie, że pojawiaja się ostrzeżenia. Co robię źle?
Kod Warning: Missing argument 1 for __construct::SQLConnection(), called in C:\WebServ\httpd\oop_mvc\index.php on line 12 and defined in C:\WebServ\httpd\oop_mvc\controller\ConfigDatabase.class.php on line 18
Warning: Missing argument 2 for __construct::SQLConnection(), called in C:\WebServ\httpd\oop_mvc\index.php on line 12 and defined in C:\WebServ\httpd\oop_mvc\controller\ConfigDatabase.class.php on line 18 Warning: Missing argument 3 for __construct::SQLConnection(), called in C:\WebServ\httpd\oop_mvc\index.php on line 12 and defined in C:\WebServ\httpd\oop_mvc\controller\ConfigDatabase.class.php on line 18 Warning: Missing argument 4 for __construct::SQLConnection(), called in C:\WebServ\httpd\oop_mvc\index.php on line 12 and defined in C:\WebServ\httpd\oop_mvc\controller\ConfigDatabase.class.php on line 18 PoĹÄ czenie nawiÄ zane! Fatal error: Call to a member function query() on a non-object in C:\WebServ\httpd\oop_mvc\controller\ConfigDatabase.class.php on line 28 |
|
|
![]() |
![]()
Post
#2
|
|
Grupa: Zarejestrowani Postów: 3 034 Pomógł: 366 Dołączył: 24.05.2012 Ostrzeżenie: (0%) ![]() ![]() |
To nie tak (IMG:style_emoticons/default/smile.gif) warunek to if(!empty($db))
To co tam deklarujesz narazie ma sie nijak do tego kodu (IMG:style_emoticons/default/smile.gif) zeby odwolac sie do zmiennej z wnetrza klasy musisz zrobic w twoim wypadku $this->host itd ale to wtedy w zasadzie nie potrzeba Ci w konstruktorze tych prametrow skoro robisz na sztywno. Musisz poczytac bo narazie nie widzisz tego zupelnie jak to wszystko dziala. A ja na telefonie tez Ci nie pomoge za bardzo. W index php zamiast zmienych wpisz normalnie dane. Bo tych zmiennych co zadeklarowales w tej postaci itak narazie nie uzywasz :-) Jak nie zapomne to naskrobie Ci przyklad popoludniu jak bd na kompie. Ale mimo wszystko bd musial zajrzec do kursu oop bo bez tego ani rusz tymbardziej ze widze to sa jakies zalazki modelu mvc (IMG:style_emoticons/default/smile.gif) Ten post edytował com 10.03.2015, 00:55:40 |
|
|
![]() ![]() |
![]() |
Aktualny czas: 7.10.2025 - 07:29 |