import MySQLdb print "Content-Type: text/html\n" sql = """\ SELECT name, release_date FROM Movie WHERE genre = 'action' """ print """\ Lab 07

Lab07 - Select Example 1

This Python code runs an SQL query, and displays the answers in an HTML table.

/* this lists the name and release date of all action movies */
""" print sql print """\


""" db = MySQLdb.connect("info20003db.eng.unimelb.edu.au", "info20003", "cisds", "info20003", 3306) cursor = db.cursor() cursor.execute(sql) rows = cursor.fetchall() print rows db.close() cursor.close() print """\ """