- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
使用 DBI();
导致此插入失败的原因 1,SELECT 调用工作正常,因此它不是凭据问题。
$dbh = DBI->connect("DBI:mysql:$dbname:$dbhost","$dbuser","$dbpass");
my $sth = $dbh->prepare( "INSERT INTO call_fields VALUES ( ?, ?, ?, ? )" ) or die print "$DBI:errstr";
$sth->execute( "NULL", 0, 0, "testing" ) or die print "er $DBI::errstr";
mysql 版本 5.5这是为 MSWin32-x64 构建的 perl 5,版本 14,subversion 1 (v5.14.1)
注意:此语法可以正常工作:
$dbh->do(q/insert into call_fields values(null,0,0,"testing")/) or die "$dbh::errstr";
最佳答案
设置RaiseError
connection attribute并让 DBI 进行错误处理。
SQL NULL value is represented as undef
在 Perl 中,不是带引号的字符串 NULL
。
use strictures;
use DBI qw();
my $dbh = DBI->connect("DBI:mysql:$dbname:$dbhost", $dbuser, $dbpass, { RaiseError => 1 });
my $sth = $dbh->prepare('INSERT INTO call_fields VALUES ( ?, ?, ?, ? )');
$sth->execute(undef, 0, 0, 'testing');
关于perl - 我的 Mysql DB 插入调用突然无声地失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8522627/
有谁知道如何使用 JS window.open(...) 但是默默地使用它,即实际上没有打开它,所以打开检查它是否能够打开? 我必须运行脚本来进行弹出 block 检查,我快完成了。我不想让浏览器物理
在一个使用远程通知的 iOS 应用程序(来自 Parse.com)中,在花了一些时间研究这个主题之后,我得出的结论是我不应该在后台使用远程通知或者可能使用静默通知。 但是无声通知看起来相当复杂。 例如
我正在编写一个函数来标准化音频文件。我正在使用 JAudioTagger 库。 我在 Logic Pro X 中创建了一个简短的音频文件,它将完全静音(如果我理解正确的话,mp3 主体的所有字节都应该
如何让 Grunt 运行更安静? 我没有 --verbose选项。我仍然得到一个很长的日志。 我想要一个更短的日志,最好只记录失败的规范。 有什么建议吗? 我正在使用 grunt-karma和 Jas
有没有办法让 Backbone.Model 静默获取?选项 {silent: true} 不适用于模型提取。基本上我想使当前 View 已经监听的同步事件静音。 收听: self.listenTo(s
在我们的应用程序中,用户将在开始工作时打卡。如果用户忘记签退,我们将在签到时间 24 小时后自动为其签退。应用程序可能不会长时间处于事件/后台状态。它可能会被终止。所以我们的想法是发布一个本地通知,通
当我的“chartModel”发生变化时,我想更新“globalModel”。 chartModel.bind("change", updateGlobalModel); updateGlobalMo
我正在将主干版本从 0.9.2 更新到 1.0,但遇到了问题。 模型未正确更新。它有延迟。以前我下面的代码工作得很好: this.model({ attrib: true},{silent:true}
我是一名优秀的程序员,十分优秀!