[DB-SIG] Sample Code of Python/MySQL

Brad Stec bstec@rulespace.com
Tue, 20 Jul 1999 10:18:11 -0700


I'm putting in some examples of the various SQL commands and ways to get the
data.  Its really for complete novices... like me. :)  I decided that as I
learn it I might as well document it.

I'll send you what I get when I get it done.

Thanks!
Brad

-----Original Message-----
From: Andy Dustman [mailto:adustman@comstar.net]
Sent: Tuesday, July 20, 1999 9:52 AM
To: Brad Stec
Cc: db-sig@python.org
Subject: Re: [DB-SIG] Sample Code of Python/MySQL


On Tue, 20 Jul 1999, Brad Stec wrote:

> Does anyone have any good sample Python source-code describing interfacing
> with mySQL?  
> 
> I'm exploring use of Andy Dustman's MySQLdb module and could use some
> reference.  I'm building up a MySQLdb API "cgi trainer" for my team with
> examples of how to exploit mySQL's basics through the module and could
sure
> use some support.  

The basics would just be whatever is in the DB API 2.0 spec over at
www.python.org. Generally it's

db=MySQL.connect(host='host',user='user',passwd='password',db='dbname')
c=db.cursor()
c.execute(query)
l=c.fetchall()

> If all goes well and it passes inspection, I'll ask Andy if he'd like to
> include it with the module files.

I'll take a look, sure. 

-- 
andy dustman  | programmer/analyst |  comstar communications corporation
telephone: 770.485.6025 / 706.549.7689 | icq: 32922760 | pgp: 0xc72f3f1d