conf/database.php中
# 数据库调试模式,开启
debug => true
然后到runtime/log对应的日志文件中搜索
SQLSTATE
一般会有类似这样的错误出现
[ error ] [10501]SQLSTATE[01000]: Warning: 1265 Data truncated for column 'stock_num' at row 1[/www/wwwroot/dancephp.com/thinkphp/library/think/db/Connection.php:764]