What I want to insert in the database is the result of an html form. In the html form, for each element of the array @identifier i have a checkbox:if it's checked then I will insert that element in the database as Feature, if it's not checked i will insert as Bug in database. So I will have in @idfeat those elements from @identifier that are checked: example: @identifier=("A1","B1","C1","D1"); @idfeat=("A1","B1");this means that A1and B1 are checked in the html form so they are Feature: I want my database to look like this:for (my $eu=0;$eu<=(scalar(@identifier));$eu++){ foreach my $id(@idfeat) { if ($id eq $identifier[$eu]){ my $sth=$dbh->prepare("INSERT INTO dd VALUES('$identif +ier[$eu]','Feature')"); $sth->execute(); $sth->finish; } else {my $sth=$dbh->prepare("INSERT INTO dd VALUES('$i +dentifier[$eu]','Bug')"); $sth->execute(); $sth->finish; } } }
But in the way I do it it looks like this:A1 Feature B1 Feature C1 Bug D1 Bug
Thank you for your timeA1 Feature A1 Bug B1 Feature B1 Bug C1 Bug C1 Bug D1 Bug D1 Bug
In reply to inserting in a database by bory
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |