The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
[SQL]
#Diary
GetAdminComments=SELECT c.*,a.title FROM comments AS c \
    INNER JOIN articles AS a ON a.articleid=c.entryid \
    WHERE c.publish=2 ORDER BY c.createdate DESC
GetAdminCommentByIP=SELECT * FROM comments AS c \
    WHERE c.publish=2 AND ipaddr=?
GetDiaryComments=SELECT * FROM comments WHERE entryid=? AND publish=3 ORDER BY createdate
CountDiaryComments=SELECT entryid,count(commentid) FROM comments WHERE entryid IN ($ids) AND publish=3 GROUP BY entryid
GetCommentByID=SELECT * FROM comments WHERE commentid=?
AddComment=INSERT INTO comments (entryid,subject,createdate,body,author,href,publish,ipaddr) VALUES (?,?,?,?,?,?,?,?)
SaveComment=UPDATE comments SET subject=?,body=?,author=?,href=? WHERE commentid=?
PromoteComment=UPDATE comments SET publish=? WHERE commentid=?
DeleteComment=DELETE FROM comments WHERE commentid=?
GetCommentsLatest=SELECT * FROM comments AS c \
    INNER JOIN articles AS a ON a.articleid=c.entryid \
    WHERE c.publish=3 ORDER BY c.createdate DESC LIMIT 5

GetDiaryDates=SELECT createdate FROM articles WHERE sectionid=6 AND publish > 2 ORDER BY createdate DESC
GetVolumes=SELECT * FROM volumes WHERE sectionid=? ORDER BY volumeid DESC
GetVolume=SELECT * FROM volumes WHERE volumeid=? AND sectionid=?
InsertVolume=INSERT INTO volumes (volumeid,sectionid,archdate,counter) VALUES (?,?,?,?)
UpdateVolume=UPDATE volumes SET counter=? WHERE volumeid=? AND sectionid=?