#!/usr/bin/python2.3 print "Content-type: text/html\n\n" import MySQLdb conn = MySQLdb.connect (host = "localhost", user = "lwtest", passwd = "lwtest127", db = "test") cursor = conn.cursor () cursor.execute ("SELECT rowid, timestamp, UNIX_TIMESTAMP( timestamp ) AS ts FROM timetest") rows = cursor.fetchall() print "
Row ID | Date | Timestamp | " print "
---|---|---|
Row %s | %s | %s | " %(row[0], row[1], row[2]) print "