Error On Making Class Static |
Здравствуйте, гость ( Вход | Регистрация )
Error On Making Class Static |
18.8.2017, 9:13
Сообщение
#1
|
|
Новенький Группа: Пользователи Сообщений: 22 Регистрация: 7.7.2017 Пользователь №: 106 456 Вставить ник Цитата |
Hello, i am trying to convert my class into a static one. The problem is now, when i try to get results of an database it gives me this error:
Quote Fatal error: Call to a member function prepare() on null in F:\xampp\htdocs\Zorg4You\inc\database.inc.php on line 42 and this is line 42: 1 $stmt = self::$db->prepare($query); i made the variable $db also static: 1 static protected $db; This is the call to the function from the page: 1 $result = database::getRows("SELECT * FROM Activiteiten"); Can anyone tell me what i am doing wrong? Please help... I didn't find the right solution from the Internet. References http://www.dreamincode.net/forums/topic/40...g-class-static/ Talent Acquisition Video |
|
|
| |
Политика конфиденциальности | Легкая версия |