我想添加功能請求確認,然後再添加條目到數據庫中,並且還想檢查數據庫中是否存在該迭代,然後應該拋出警告消息。我的代碼是:確認消息和警告消息設置
真正創造迭代
my $dbh = DBI->connect(
"dbi:mysql:dbname=agilefant-test",
"agilefant-test",
"Agilefant-test",
{ RaiseError => 1 },
) or die $DBI::errstr;
foreach $iter (keys(%iterations)) {
my $req = "INSERT into backlogs (backlogtype, name, startDate, endDate, parent_id) VALUES ('Iteration', '$iter', '" .
$iterations{ $iter }->{start} . " 08:00', '" .
$iterations{ $iter }->{end} . " 18:00', '" .
$project . "');" ;
print $req . "\n";
my $sth = $dbh->prepare("INSERT into backlogs (backlogtype, name, startDate, endDate, parent_id) VALUES ('Iteration', '$iter', '" .
$iterations{ $iter }->{start} . " 08:00', '" .
$iterations{ $iter }->{end} . " 18:00', '" .
$project . "');");
$sth->execute() or die $DBI::errstr;
$sth->finish();
}
難道你不能提出一個比'你好,我想問'更好的問題標題嗎? – devnull
@devnull感謝您的建議 –
您不需要在問題標題中包含語言。改用標籤。 – devnull