Skip to content

Instantly share code, notes, and snippets.

@mathisve
Last active August 20, 2020 12:45
Show Gist options
  • Save mathisve/28ed432abee9d81ea91c4f79030d342f to your computer and use it in GitHub Desktop.
Save mathisve/28ed432abee9d81ea91c4f79030d342f to your computer and use it in GitHub Desktop.
CoreProtect SQL queries
USE logging;
SELECT
DATE(FROM_UNIXTIME(co_chat.time)),
co_user.user,
message
FROM
co_chat
LEFT JOIN co_user
ON co_user.rowid = co_chat.user
ORDER BY
co_chat.rowid DESC;
USE logging;
SELECT
FROM_UNIXTIME(co_session.time),
co_user.user,
action
FROM
co_session
LEFT JOIN co_user
ON co_user.rowid = co_session.user
ORDER BY
co_session.rowid DESC;
USE logging;
SELECT
rowid,
DATE(FROM_UNIXTIME(time)),
user
FROM
co_user
WHERE user NOT LIKE "#%";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment