public static function delete_seminar_with_users($id) {
#Jetzt muessen auch alle User (Teilnehmer dieser Seminar geloescht werden)
User::delete_all_users_in_seminar ( $id );
$this->delete ();
}
public function delete() {
global $database;
#Und jetzt Record im seminars table auch loeschen
$sql = "DELETE FROM " . self::$table_name;
$sql .= " WHERE id=" . $database->escape_value ( $this->id );
$sql .= " LIMIT 1";
$database->query ( $sql );
return ($database->affected_rows () == 1) ? true : false;
}
now when from my test.php file i call
$seminar_delete = Seminar::delete_seminar_with_users(2);
i get the error about the line
$this->delete ();
[php] Using $this when not in object context in <b>seminar.php</b> on line <b>140</b><br />
how can i replace it, so it runs well in combination with the delete() function?
thanks in advance.


Sign In
Create Account

Back to top









