Source of the problem: $db -> listOccurrences();
I tried this:
public function listAbsences()
{
$this->connect();
$sql = "SELECT description FROM records WHERE _ID_Record_Type = 1;"
$sqlquery = mysqli_query($this->conn, $sql);
if (mysqli_num_rows($sqlquery) > 0){
$result = array();
while($row = mysqli_fetch_assoc($sqlquery)) {
$result[] = '$row["description"];
}
return $result;
}
$this->close_connect();
}
And this:
public function listAbsences()
{
$this->connect();
$sql = "SELECT description FROM records WHERE _ID_Record_Type = 1;"
$sqlquery = mysqli_query($this->conn, $sql);
if (mysqli_num_rows($sqlquery) > 0){
$result = array();
while($row = mysqli_fetch_assoc($sqlquery)) {
$result[] = '<li class="list-group-item">'.$row["description"].'</li>';
}
return $result;
}
$this->close_connect();
}
And this:
public function listAbsences()
{
$this->connect();
$sql = "SELECT description FROM records WHERE _ID_Record_Type = 1;"
$sqlquery = mysqli_query($this->conn, $sql);
if (mysqli_num_rows($sqlquery) > 0){
$result = "";
while($row = mysqli_fetch_assoc($sqlquery)) {
$result .= "<li class='list-group-item'>".$row["description"]."</li>";
}
echo $result;
}
$this->close_connect();
}
But I've kept having the same error:
Fatal error: Uncaught Error: Call to undefined method db::listOccurrences() in C:\xampp\htdocs\lar\start.php:39 Stack trace:#0 {main} thrown in C:\xampp\htdocs\lar\start.php on line 39