Received: from csunb.mit.csu.edu.au (csunb.mit.csu.edu.au [137.166.16.1]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id eA986cs08998 for ; Thu, 9 Nov 2000 03:06:39 -0500 (EST) (envelope-from ahexse01@postoffice.csu.edu.au) Received: from postoffice.csu.edu.au (postoffice.csu.edu.au [137.166.201.112]) by csunb.mit.csu.edu.au (8.9.3/8.9.3) with SMTP id TAA03632 for ; Thu, 9 Nov 2000 19:05:45 +1100 (EST) From: "Astrid Hexsel" Reply-to: ahexse01@postoffice.csu.edu.au To: pgsql-sql@postgresql.org Date: Thu, 9 Nov 2000 19:05:46 +1100 Subject: insert value of form - checkboxes X-Mailer: DMailWeb Web to Mail Gateway 2.5e, http://netwinsite.com/top_mail.htm Message-id: <3a0a5ada.2ef3.0@postoffice.csu.edu.au> X-User-Info: 137.166.125.8 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Archive-Number: 200011/65 X-Sequence-Number: 96 Hello all, I have a form which has got checkboxes and I am having problems to have their values stored in different rows of a table. What I have done is: # colour_id is the name of my checkboxes in the input tag etc ... # I put all the values into the array and split them $colour = $formdata{'colour_id'}; @colours = split (/,/, $colour); #then I want to insert then into a table (called cart)in the row called colour_id. If I have more than one value they have to be in different rows. # my code: foreach $colour(@colours) { $qry = INSERT INTO cart VALUES ('$session_id', '$range_id', '$colour') } And what happens is that I am only getting just one value now inserted in the row. If for example I checked 3 boxes I will get only the last one. The foreach loop works fine out of the query. Thanks a lot for any help. Astrid