baxy77bax has asked for the wisdom of the Perl Monks concerning the following question:
this obviously doesn't work. but the thing is that each data in the @titula that was found in the database i would like to change and associate with data in the @wage any advice would be helpful. thank you, robertuse strict; use DBI; my $driver = "mysql"; my $dns = "database=baxy"; my $username = "baxy"; my $password = ""; my $dbh = DBI -> connect ("dbi:$driver:$dns", $username, $password, {A +utoCommit => 1}); my $titula = [qw(ing dipl. dipl.ing. dr phd)]; my $wage = [qw(10 20 30 50 200)]; my $sth = $dbh->prepare ("update Staff set wage = @$wage where positio +n = ?") or die "$DBI::errstr"; foreach my $x (@$titula) { $sth -> execute($x)|| die "$DBI::errstr"; } $sth -> dump_results();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: change data in the mysql through DBI
by Corion (Patriarch) on Apr 05, 2008 at 18:10 UTC | |
by baxy77bax (Deacon) on Apr 05, 2008 at 20:07 UTC | |
by Corion (Patriarch) on Apr 05, 2008 at 20:21 UTC | |
|
Re: change data in the mysql through DBI
by bradcathey (Prior) on Apr 06, 2008 at 02:10 UTC |