smr/src/sql/select_post.sql

22 lines
323 B
MySQL
Raw Normal View History

/*
Select the data we need to read a story (and maybe display an edit button)
*/
SELECT
post_title,
post_text,
posts.authorid,
posts.isanon,
authors.name,
views
FROM
posts,authors
WHERE
posts.authorid = authors.id AND
2021-01-10 22:34:13 +01:00
posts.id = :id AND
(
posts.unlisted = 1 AND
posts.hash = :hash
) OR
posts.unlisted = 0;