问题描述
我正在使用Kohana 3.
I'm using Kohana 3.
我正在编写一个更新查询,它适用于除此部分以外的所有内容.
I'm writing an update query, and it is working for everything except this one section.
如果对$db->execute()
的结果执行var_dump()
,则得到1或0表示失败或失败.在此示例中失败(返回0).
If I do a var_dump()
on the results of $db->execute()
I get either a 1 or 0 to say it failed or not. It is failing in this example (returning 0).
如何确定发生了什么错误?暂时似乎只是默默的失败.我尝试做echo mysql_error()
,但没有按我预期的那样工作,因为我很确定Kohana 3的数据库库使用PDO.
How can I figure out what error is happening? It justs seems to be silenty failing at the time being. I tried doing echo mysql_error()
but it didn't work, as I expected, as Kohana 3's db library uses PDO I'm pretty sure.
如何找出发生的错误?
推荐答案
尝试在调用$db->execute()
之后执行此操作:
Try executing this after calling $db->execute()
:
echo Database::instance()->last_query
这篇关于在Kohana 3中,您如何确定查询期间发生的错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!