In my application I'm writing up to 120 fields of data in one swoop 
(the results of a sort of survey).  I'm using Perl DBI with MySQL.

Each survey has several fields of data like 'name' (stored as 
parameters in the CGI object $asmt) and then up to 100 actual survey 
questions (Q1, Q2, etc).  Until now I've just written one line of 
data to a text file, like:

        # Write basic data
        print FILE asmt -> param('name') . "\t";
        print FILE asmt -> param('city') . "\t";

        $v = 1;

        #write response to each question (Q1, Q2 etc)
        while ($v <= $questions) {
                $x = "Q" . $v;
                print FILE $asmt -> param($x). "\t";
                $v++;
        }

And this works fine for the text file - but from what I've seen I 
probably can't carry over the iteration through the (up to) 100 
actual survey questions.  I named the MySQL fields 'q1', 'q2', 
anticipating some way to do a loop, but I can't see it.

Does anyone have any suggestions of how best to do this?  The thought 
of one huge INSERT statement makes my eyes glaze over - I'm hoping 
there is a more elegant alternative.

Thanks,
Nelson

-- 

===========================================================
Nelson Goforth                 Lighting for Moving Pictures
phone: 01.303.322.5042               pager: 01.303.634.9733
    resume: http://www.earthnet.net/~ngoforth/film

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to