编辑:添加了PDO调用.
这是实际错误:
Notice: Object of class PDOStatement could not be converted to int in Unknown on line 0
我怎么能一般找出哪一行是错误/通知的正确行,因为它不是第0行?
我尝试使用register_tick_function echoing out file:line,这不起作用,因为通知总是在我的总输出结束时输出.
我正在寻找一种通用的调试方式,因为我在该对象的类中找不到任何错误.
// PHP PDO Standard
$db_server = 'mysql:host='.$this->db_host.';dbname='.$this->db_dbase;
try {
$this->db_connection = new PDO($db_server, $this->db_user, $this->db_pass);
$pdo_set = $this->db_connection->setAttribute(PDO::ATTR_EMULATE_PREPARES, FALSE);
$pdo_set = $this->db_connection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$pdo_set = $this->db_connection->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC);
//DebugPrint($pdo_set, '$pdo_set');
} catch (PDOException $e) {
//print 'Error!: '.$e->getMessage().'
';
die();
}