1. Home
  2. Computing & Technology
  3. Python

Reading from a MySQL Database With Python

From Al Lukaszewski, for About.com

6 of 6

Where To Go From Here

In this way, one can quickly query the key value of a MySQL table. Of course, if we changed the superscript of 'fvalues' to 1 instead of 0, the program would check the second field, and so on. A fuller implementation than this example might also allow the user to define the row of the table. On a simpler level, if one simply wants to read the entire table out, one simply need remove the if loop and to unindent the print command to the appopriate level.

Needless to say, this only scratches the surface of what you can do with MySQLdb. Future tutorials on this module are planned. But if you cannot wait and want to dig in, see the MySQLdb User's Guide here .

Explore Python
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. Python
  4. Database Programming
  5. Reading Python Data From a MySQL Database - Where To Go From Here

©2009 About.com, a part of The New York Times Company.

All rights reserved.