Re: [Zope] MySQL queries in Python

2006-08-01 Thread Paul Winkler
On Tue, Aug 01, 2006 at 02:50:19PM -0400, Muk Yan wrote: > Dear Coveted Braintrust, > > I was wondering if anyone had any experience with MySQL queries in Python in > Zope: People have already answered your main question, but: > SELECT name > FROM person > WHERE ID = Never ever pass raw user i

Re: [Zope] MySQL queries in Python

2006-08-01 Thread Dennis Allison
Usually you install the database adaptor ZMySQLDB and make queries through a ZSQL Method object. On Tue, 1 Aug 2006, Muk Yan wrote: > Dear Coveted Braintrust, > > I was wondering if anyone had any experience with MySQL queries in Python in > Zope: > > import MySQLdb > import string > > reque

Re: [Zope] MySQL queries in Python

2006-08-01 Thread John Barham
import MySQLdb This is probably redundant. import string request = container.REQUEST session = request.SESSION result = (context.aq_parent).selects.select_from_table() print result Assuming you want the person's name printed, change this line to: print result[0].name Think of the resul

Re: [Zope] MySQL queries in Python

2006-08-01 Thread Andreas Jung
--On 1. August 2006 14:50:19 -0400 Muk Yan <[EMAIL PROTECTED]> wrote: I know the MySQL query works, but I get garbage results from the python script (). All I want is to contain the results of the SQL query in a list or container. Zope Book 2.7 edition -> RDBMS chapter. The result object i

Re: [Zope] MySQL queries in Python

2006-08-01 Thread Jonathan
Have a look at this:   http://www.zope.org/Members/spinwing/ZSQL_Results       Jonathan - Original Message - From: Muk Yan To: zope@zope.org Sent: Tuesday, August 01, 2006 2:50 PM Subject: [Zope] MySQL queries in Python Dear Coveted Braintrust,I was wondering if

[Zope] MySQL queries in Python

2006-08-01 Thread Muk Yan
Dear Coveted Braintrust,I was wondering if anyone had any experience with MySQL queries in Python in Zope:import MySQLdbimport stringrequest = container.REQUESTsession = request.SESSION result = (context.aq_parent).selects.select_from_table()print resultreturn printedWHERE select.select_from_table(