[prev in list] [next in list] [prev in thread] [next in thread]
List: python-db-sig
Subject: [DB-SIG] alo
From: wilk-ml () flibuste ! net (William Dode)
Date: 2003-03-11 9:44:48
Message-ID: 87wuj65jan.fsf () flibuste ! net
[Download RAW message or body]
"Gerardo Rodriguez Gutierrez" <grg@itesm.mx> writes:
> Do you have code example for basing me? I need to connect to MySQL and
> display it into a html table by colums and rows.
import MySQLdb
db=MySQLdb.connect(db="cci",host="localhost",user="me",passwd="")
cursor=db.cursor()
cursor.execute("select id_adherent,nom from cci_adherent")
print "<table>"
for row in cursor.fetchall():
print "<tr><td>%s</td><td>%s</td></tr>"%(row[0],row[1])
print "</table>"
--
William Dodé - http://flibuste.net
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic