Logs::log PHP Method

log() public method

public log ( $type, $txt, $userid, $anonym )
    public function log($type, $txt, $userid, $anonym = 0)
    {
        $searchText = Helper::searchfield($txt);
        $sth = $this->db->prepare('INSERT INTO sitelog (typ, added, txt, search_text, userid, anonymous) VALUES (?, NOW(), ?, ?, ?, ?)');
        $sth->bindParam(1, $type, PDO::PARAM_INT);
        $sth->bindParam(2, $txt, PDO::PARAM_STR);
        $sth->bindParam(3, $searchText, PDO::PARAM_STR);
        $sth->bindParam(4, $userid, PDO::PARAM_INT);
        $sth->bindParam(5, $anonym, PDO::PARAM_INT);
        $sth->execute();
    }