def query():
conn= MySQLdb.connect(
host='localhost',
port = 3306,
user='root',
passwd='1234567',
db ='tlcb',
)
cur = conn.cursor()
a=cur.execute("select title,body, DATE_FORMAT(timestamp,'%Y~%m~%d %k.%i.%s') A from blog_blogpost")
info = cur.fetchmany(a)
print info
print type(info)
return info
cur.close()
conn.close()