Tags
Python Tips
HostGator switched to Python MySQLdb connectors for shared hosting, after I completed this series. The primary coding differences follow.
import MySQLdb
instead ofimport mysql.connector
.- Connect with
cnx = MySQLdb.connect(host,user,password,database)
instead ofcnx = mysql.connector.connect(user, password,host,database)
- Access columns with
columns = mycursor.description
instead ofmycursor.column_names
. - Columns return as a tuple of tuples, instead of a list of lists.
- Tuples required some extra formatting as well.
See Python tips and examples at Seven Thunder Software. Python is versatile and runs well with server and middleware applications. Python enables a wide range of features allowing multiple online uses.