this is the class:
class abc extend def {
public static function count_all() {
$sql = "SELECT COUNT(*) FROM " . self::$table_name;
$sql= $this -> conn -> prepare($sql);
$sql -> execute();
return $row = $sql -> fetchAll();
}
}
after createing on veiew
$abs = new abs();
$total_count = abc::count_all();
echo $total_count;
it should echo the total count but when i echo this it show the error
Fatal error: Using $this when not in object context in
how i can solve it regards in advance.