<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.2912" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Have a look at this:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2><A
href="http://www.zope.org/Members/spinwing/ZSQL_Results">http://www.zope.org/Members/spinwing/ZSQL_Results</A></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Jonathan</FONT></DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=mukyan@gmail.com href="mailto:mukyan@gmail.com">Muk Yan</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=zope@zope.org
href="mailto:zope@zope.org">zope@zope.org</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Tuesday, August 01, 2006 2:50
PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> [Zope] MySQL queries in
Python</DIV>
<DIV><BR></DIV>Dear Coveted Braintrust,<BR><BR>I was wondering if anyone had
any experience with MySQL queries in Python in Zope:<BR><BR>import
MySQLdb<BR>import string<BR><BR>request = container.REQUEST<BR>session =
request.SESSION<BR><BR>result =
(context.aq_parent).selects.select_from_table()<BR><BR>print result<BR>return
printed<BR><BR>WHERE select.select_from_table() IS:<BR><BR>SELECT name<BR>FROM
person<BR>WHERE ID = <dtml-var "REQUEST.SESSION.get
('person_id')"><BR><BR>I know the MySQL query works, but I get garbage
results from the python script (<Shared.DC.ZRDB.Results.Results instance at
0x132a5c88>). All I want is to contain the results of the SQL query
in a list or container. <BR><BR>Thanks and take care,<BR>Muk Yan<BR>
<P>
<HR>
<P></P>_______________________________________________<BR>Zope maillist
-
Zope@zope.org<BR>http://mail.zope.org/mailman/listinfo/zope<BR>**
No cross posts or HTML encoding! **<BR>(Related lists -
<BR> http://mail.zope.org/mailman/listinfo/zope-announce<BR> http://mail.zope.org/mailman/listinfo/zope-dev
)<BR></BLOCKQUOTE></BODY></HTML>