- Code: Select all
my $table="table";
foreach $a(@array){
my $state="INSERT INTO ".$table." (uid,item) VALUES (LAST_INSERT_ID(),?)";
my $sth=$dbh->prepare($state);
$sth->execute($a);
}
The array is taken from a series of checkboxes with values numbered from 1 through 7. The best I can get is the first number inserted but then it seems to leave the loop. My hope was to insert into more than one row depending on which check boxes were selected such as:
- Code: Select all
uid item
1 2
1 4
with item being the checkbox selected. I hope I have been detailed enough. I'm using version 1.7.7 with Windows 7 Any help would really be appreciated.
typomaniac