September 2010
Intermediate to advanced
440 pages
9h 23m
English
In making a phone call, one picks up the handset, dials a number, talks and listens, and then hangs up. Making a database connection through MySQL for Python is nearly as simple. The four stages of database communication in Python are as follows:
connection objectcursor object As mentioned previously, we use connect() to create an object for the program's connection to the database. This process automates logging into the database and selecting a database to be used.
The syntax for calling the connect() function and assigning the results to a variable is as follows:
[variable] = MySQLdb.connect([hostname], [username], [password],[database ...
Read now
Unlock full access