需要调试 db_insert 但没有给出错误
我在 D7 安装中有一个自定义模块。
在提交函数中,我执行以下操作:
my_custom_block_get_form_submit($form, &$form_state) {
$d = db_insert('db_launch')
->fields(array(
'uniq' => $uniq
))
->execute();
执行代码后,我在错误日志中没有收到任何错误,并且站点返回标准“此网站遇到错误”。
有谁知道我如何调试这个?我尝试了 try catch 块,但没有返回任何内容。
谢谢,
I have a custom module in a D7 installation.
In the submit function I'm doing the following:
my_custom_block_get_form_submit($form, &$form_state) {
$d = db_insert('db_launch')
->fields(array(
'uniq' => $uniq
))
->execute();
After executing the code, I get no errors in the error log, and the sites returns the standard "This website has encountered an error".
Does anyone have idea how I can debug this? I tried a try catch block but that didn't return anything.
Thanks,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
要调试此代码,您应该尝试这样做:
请注意,这将返回带有占位符的查询。如果您希望获取具有实际值的查询,您应该启用
devel.module
,然后:To debug this code, you should try doing it this way:
Note that, this will return the query with placeholders. If you wish to obtain the queries with actual values, you should have
devel.module
enabled and then:要调试此代码,您应该尝试此操作。
此代码打印 db_launch 表的自动增量 id。
To debug this code you should try this.
This code print the auto increment id of db_launch table.