I develope web app on a windows machine using xampp server, php 8.2 and ci4. Everythin was working fine but not when i deploy it to a linux live server with php 8.1.
The landing page of the web app is the login page where through normal ci4 helper function to the databases table model, i will have to fetch some data from the mysql database to display some information. its was working as intended on locahost but fail on live server, please see the error below:
TypeError
mysqli_result::fetch_object(): Argument #1 ($class) must be a valid class name, App\Entities\schoolEnt given
this is the function from the model, the model returnType is entity class
public function getSchoolData($session = null)
{
if($session !== null) {
$d = $this->where('session', $session)->orWhere('sessID', $session)->first();
return $d;
}
else {
$d = $this->where('active', 1)->first();
return $d;
}
}
this the function from the helper
if (! function_exists('schoolData'))
{
function schoolData($data, $session = null)
{
$builder = Model('SchoolModel');
$result = $builder->getSchoolData($session);
if($data === true) {
return $result;
}
return $result->$data;
}
}
please help me out.