bory has asked for the wisdom of the Perl Monks concerning the following question:
If i have in the database the following entries:my @name=("Anna","Maria","Carmen"); my @age=("25","27","29"); my @eyes=("brown","blue","pink"); #those arrays have always the same number of elements for (my $i=0;$i<=$#name;$i++){ my $sth=$dbh->prepare(qq{UPDATE tnt SET `Age`=\"$age[$i]\",`Ey +es`=\"$eyes[$i]\" WHERE `Name`=\"$name[$i]\"}); $sth->execute(); } $sth->finish;
After updating in my way:Name Age Eyes Corina 13 red Ada 17 blue Anna 10 grey Maria 2 white Carmen 6
and i lose the other records. Thank you very much for your timeAnna 25 brown Maria 27 blue Carmen 29 pink
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: updating a database
by Abigail-II (Bishop) on Feb 10, 2004 at 10:28 UTC | |
|
Re: updating a database
by borisz (Canon) on Feb 10, 2004 at 09:44 UTC |