in reply to $data{"str$i"} not valid in mysql select?
$store = qq-INSERT INTO main (creator_name,relationship) VALUES(?, ?)- +; my $sth = $dbh->prepare($store); for my $i (0..3) { $sth->execute($data{creatorname}, $data{"relationship$i"}); # or a nicer syntax using a hash slice: # $sth->execute( @data{ "creatorname", "relationship$i" } ); }
|
|---|