help with this simple DB script

John Salerno johnjsal at
Wed May 17 03:09:17 CEST 2006

Ok, before I contact my server host, I figured I should make sure I'm 
not just making a Python mistake. I get an Internal Server Error with 
this script:


import MySQLdb

db = MySQLdb.connect(host='xxx',
                      db='xxx') # changed this stuff

cursor = db.cursor()
cursor.execute("CREATE TABLE test (first varchar(10), second number(2))")
cursor.execute("INSERT INTO test (first, second) VALUES ('Hello', 33)")
cursor.execute("SELECT first, second FROM test")

All I do is run it directly with my URL, not sure if there's more to it.

More information about the Python-list mailing list