All,
This is the current code I am trying to use, it is modeled after some examples
I have seen. If someone can provide a better example or way to access the MySQL
server and pull or push data to a database on the server that would be
appreciated.
##Database name is Test, Table name is Test1, feild is name,Fred, and PKID##
def sqlconnect():
import _mysql
import MySQLdb
db=_mysql.connect(host="10.15.10.201",user="bjchadwick",
passwd="checkthis",db="test")
db.query("""SELECT * FROM Test1 WHERE name""")
print "Connected"
sqlconnect()
def data():
class Table:
def __init__(self, db, test):
self.db = db
self.name = Test1
self.dbc = self.db.cursor()
def __getitem__(self, item):
self.dbc.execute("SELECT * FROM Test1" %
(self.name, item))
return self.dbc.fetchnone()
for i in xrange(80, 100):
print "Data %s: %s" (i, Test1[i])
data()
Thanks,
Ex - 3016
Brett Chadwick
VO Administrator
GC Services
[EMAIL PROTECTED]
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Behalf Of [EMAIL PROTECTED]
Sent: Wednesday, August 10, 2005 3:00 AM
To: [email protected]
Subject: DB-SIG Digest, Vol 29, Issue 4
Send DB-SIG mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
http://mail.python.org/mailman/listinfo/db-sig
or, via email, send a message with subject or body 'help' to
[EMAIL PROTECTED]
You can reach the person managing the list at
[EMAIL PROTECTED]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of DB-SIG digest..."
_______________________________________________
DB-SIG maillist - [email protected]
http://mail.python.org/mailman/listinfo/db-sig