Re-reading my message I noticed a stupid error, not effecting my problem but annoying, I assigned variables and then did not use them, then included import cgi for my regular script. This is how the command line script should look:
#!/usr/bin/python import MySQLdb db=MySQLdb.connect(host = '192.168.0.112', db = 'phone') cursor=db.cursor() cursor.execute("Select * from phone") result = cursor.fetchall() for record in result: print record[0],record[1],record[2] -- http://mail.python.org/mailman/listinfo/python-list