+import time
+
+# function to create an article
+def create_article (dbname, title, summary, keywords, content, catid, stub, rating):
+ # time of creation
+ creattime = time.time ()
+ modtime = creattime
+ try:
+ conn = sqlite3.connect (dbname)
+ c = conn.cursor ()
+ c.execute ("INSERT INTO articles (title, summary, keywords, content, cdate, mdate, cid, stub, rating) \
+ VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?);", (title, summary, keywords, content, creattime,
+ modtime, catid, stub, rating))
+ conn.commit ()
+ conn.close ()
+ return True
+ except sqlite3.Error:
+ return False
+
+# function to delete an article
+def delete_article (dbname, artid):
+ try:
+ conn = sqlite3.connect (dbname)
+ c = conn.cursor ()
+ c.execute ("DELETE FROM articles WHERE aid=?;", (artid,))
+ conn.commit ()
+ conn.close ()
+ return True
+ except sqlite3.Error:
+ return False