[Re: [Zope-DB] Connecting to MySQL DB from infoForm / infoAction]
Martin Gebert
Murphy@members.netsolution-net.de
Fri, 03 Jan 2003 22:53:44 +0100
Paul Resnikoff schrieb:
>Thanks Martin. I got every step to work except "use it
>from within your action file" Can you suggest code to insert in the action
>file to add info to the mysql table?
>
>
That's quite simple and also described in the ZopeBook. I presume you've
created the Z SQL Method containing an INSERT statement and accepting
the mail address as parameter. You only have to call this Method from
within your script, giving it the parameters, like
myZSqlMethod(parameter_mail = request.mailaddress)
I'm sure you'll also find examples with a short search on the Zope
website or at Google, but if you want you can also have a look into a
How-To I wrote; it's mainly about using BLOBs, but if you abstract from
the code examples you can also get a grasp how Z SQL Methods are used
(it's quite simple, really, if you've done your homework concerning
Python!):
http://www.zope.org/Members/murphy/MySQL-BLOBs
And another time: Read The ZopeBook!
Have fun!
Martin