in reply to perl dbi problem1
Your problem is that the UPDATE syntax is wrong. You want to say:
my $statement = qq( UPDATE LEAGUE SET played = ?, won = ?, fr = ?, ag = ?, points = ? WHERE year = ? AND sport = ? AND group = ? ); $dbh->do($statement, {}, $playeda, $wona, $fora, $againsta, $pointsa, $thisyear, $sport, $group) || die "SQL error in update 1";
Besides fixing the syntax, I used bind variables in the do to allow DBI to escape the strings for me correctly to make sure that all SQL metacharacters are safe. The qq() thing just makes up a string (but I find it more readable to write my SQL queries that way).
Hope that helps.
-ben
|
|---|