#!/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 "" print "" print "" print "" for row in rows: print "" print "" %(row[0], row[1], row[2]) print "" print "
Row IDDateTimestamp
Row %s%s%s
" #print "server version:", row[0] cursor.close () conn.close ()