如何在Agiletookit中调试数据库相关的错误? ATK4

时间:2013-10-20 14:50:10

标签: php mysql atk4 agiletoolkit

我知道$ m-> debug();如上所述here

但我不知道应该如何开始调试以下问题。我的方法是在dsql.php中进行var_dump并比较字段,然后在OOP层中逐步向上。我想知道是否有一些简单的方法可以做同样的事情。

实际错误:

/Users/Qambar/Work/VERYCOOLAWESOMEPROJECT/atk4/lib/DB/dsql.php  :1518   bozims_db_db_dsql_mysql DB_dsql_mysql-  >exception("Database Query Failed")

完整日志

/Users/Qambar/Work/VERYCOOLAWESOMEPROJECT/atk4/lib/BaseException.php    :63     Exception_DB    Exception_DB->collectBasicData(Null)
/Users/Qambar/Work/VERYCOOLAWESOMEPROJECT/atk4/lib/AbstractObject.php   :545    Exception_DB    Exception_DB->__construct("Database Query Failed", Null)
/Users/Qambar/Work/VERYCOOLAWESOMEPROJECT/atk4/lib/DB/dsql.php  :1518   bozims_db_db_dsql_mysql DB_dsql_mysql->exception("Database Query Failed")
/Users/Qambar/Work/VERYCOOLAWESOMEPROJECT/atk4/lib/DB/dsql.php  :1545   bozims_db_db_dsql_mysql DB_dsql_mysql->execute()
/Users/Qambar/Work/VERYCOOLAWESOMEPROJECT/atk4/lib/SQL/Model.php    :635    bozims_db_db_dsql_mysql DB_dsql_mysql->insert()
/Users/Qambar/Work/VERYCOOLAWESOMEPROJECT/atk4/lib/SQL/Model.php    :610    bozims_fileadmin_form_Upload_test_filestore_model_file  filestore\Model_File->insert()
/Users/Qambar/Work/VERYCOOLAWESOMEPROJECT/atk4/lib/Form/Field/Upload.php    :143    bozims_fileadmin_form_Upload_test_filestore_model_file  filestore\Model_File->save()
/   :   bozims_fileadmin_form_Upload_test   Form_Field_Upload->loadPOST(Object(Form))
/Users/Qambar/Work/VERYCOOLAWESOMEPROJECT/atk4/lib/AbstractObject.php   :786        Loggercall_user_func_array(Array(2), Array(1))
/Users/Qambar/Work/VERYCOOLAWESOMEPROJECT/atk4/lib/Form/Basic.php   :348    bozims_fileadmin_form   Form->hook("loadPOST")
/   :   bozims_fileadmin_form   Form->submitted(Object(Frontend))
/Users/Qambar/Work/VERYCOOLAWESOMEPROJECT/atk4/lib/AbstractObject.php   :786        Loggercall_user_func_array(Array(2), Array(1))
/Users/Qambar/Work/VERYCOOLAWESOMEPROJECT/atk4/lib/ApiWeb.php   :290    bozims  Frontend->hook("submitted")
/Users/Qambar/Work/VERYCOOLAWESOMEPROJECT/index.php :5  bozims  Frontend->main()

1 个答案:

答案 0 :(得分:1)

通常 - 执行一个debug(),它会给你一个查询本身。将查询复制粘贴到SQL控制台中。如果你在那里遇到错误,那就试着理解为什么。

您还可以使用setActualFields缩小查询字段列表的范围,这将使您的查询更简单。

这应该可以帮助你缩小问题的范围。