mirror of
https://github.com/twisterarmy/twister-analytics-crawler.git
synced 2025-01-30 08:24:15 +00:00
21 lines
418 B
PHP
21 lines
418 B
PHP
<?php
|
|
|
|
class ModelLog extends Model {
|
|
|
|
public function add($message) {
|
|
|
|
try {
|
|
|
|
$query = $this->db->prepare('INSERT INTO `log` SET `message` = ?, `timeAdded` = UNIX_TIMESTAMP()');
|
|
|
|
$query->execute([$message]);
|
|
|
|
return $this->db->lastInsertId();
|
|
|
|
} catch (PDOException $e) {
|
|
trigger_error($e->getMessage());
|
|
return false;
|
|
}
|
|
}
|
|
}
|