The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
[SQL]
#Links
AllLinks=SELECT * FROM links
GetLinkByID=SELECT * FROM links WHERE linkid=?
AddLink=INSERT INTO links (title,href,body,catid) VALUES (?,?,?,?)
SaveLink=UPDATE links SET title=?,href=?,body=?,catid=? WHERE linkid=?
DeleteLink=DELETE FROM links WHERE linkid IN ($ids)

GetLinks=SELECT * FROM links AS l \
    INNER JOIN linkcat AS c ON c.catid=l.catid \
    ORDER BY c.orderno,c.category,l.title
GetCategories=SELECT * FROM linkcat ORDER BY orderno,catid
GetCategoryByID=SELECT * FROM linkcat WHERE catid=?
NewCategory=INSERT INTO linkcat (orderno,category) VALUES (?,?)
SaveCategory=UPDATE linkcat SET orderno=?,category=? WHERE catid=?
DeleteCategory=DELETE FROM linkcat WHERE catid IN ($ids)
DeleteCatLinks=DELETE FROM links WHERE catid IN ($ids)