There is a file lorem.php, there is a code in it:
<?php class Header { public static function getData() { $db = Db::getConnection(); In this file, everything works fine, database queries are executed. But when I want to get a variable from this file in another:
<?php include_once('/../models/lorem.php'); $resultid = Header::getData(); That gives me an error: Fatal error: Class 'Db' not found in D: \ wamp \ www \ models \ lorem.php
Probably useful information will be that the second file is called by an Ajax request in an html file in another directory. Already tried everything in different varriations, nothing helps ...