[Zope-DB] multiple data insert (MySQL, Zope)

Fejes Róbert pouch@freemail.hu
Sat, 26 Oct 2002 08:26:13 +0200

Hi list members out there,

I'm new on this list, and only got to know Zope 3 months ago:) I made a 
library database in MySQL but I can't insert books with more than 2 authors, 
publishers, languages, genres through webpages. I can choose the 
authors, languages,  publishers, genres from a drop-down list (actually a 
dynamic list with multiple choice; here is the code:

<tr><td>Language(s): </td>
    <td><select name="lang_id" size=4 multiple>
        <option value="2">English
        </option><select name="lang_id" size=4 multiple>
        <option value="1">Hungarian
        </option><select name="lang_id" size=4 multiple>
        <option value="3">German
        </option><select name="lang_id" size=4 multiple>
        <option value="5">Italian
        </option><select name="lang_id" size=4 multiple>
        <option value="4">Russian

 When a book has one publisher, one author, one language, one genre everything 
goes well:)

The ZSQL method I use is:

insert into book (book_id, title, btype_id, p_year, ISBN) values (
<dtml-sqlvar book_id type="int">,
<dtml-sqlvar title type="string">,
<dtml-sqlvar btype_id type="int">,
<dtml-sqlvar p_year type="int">,
<dtml-sqlvar ISBN type="string">)

Do I have to modify the ZSQL method and/or write some DTML code to insert data 
one after the other (sequence)?

Thank you very much for your advice.

Bye: FeRó
//SuSE 8.0, Python 2.2, Zope 2.5, MySQL 3.23.48