以下代码正在破坏我的 apache Web 服务器。当我从中删除数据库查询时parse_service_rows()
,apache 不会崩溃。
我还尝试在没有帮助的情况下从查询中删除 WHERE 子句。
我的代码如下所示:
public function tab($tab_name = '') {
/*
* CODE TO GET ROWS
*/
$service['rows'] = array_map(array($this, 'parse_service_rows'), $service['rows']);
}
private function parse_service_rows($row) {
// This query causes apache to crash
$order = $this->db->get_where('services', array(
'service_user_id' => $this->user->get('user_id'),
'service_firm_id' => $this->firm->id,
'service_type' => $row['type'],
'service_object_id' => $row['object_id']
), 1)->row_array();
return $row;
}
但是,当我尝试使用foreach
而不是array_map
:
foreach ($service['rows'] as $key => $row) {
$service['rows'][$key] = $this->parse_service_rows($row);
}
Windows 错误窗口提供以下信息:
Problem Event Name: APPCRASH
Application Name: httpd.exe
Application Version: 2.4.2.0
Application Timestamp: 4fafa3e6
Fault Module Name: php5ts.dll
Fault Module Version: 5.4.4.0
Fault Module Timestamp: 4fd8f85c
Exception Code: c0000005
Exception Offset: 000713cd
OS Version: 6.1.7600.2.0.0.256.1
Locale ID: 1061
Additional Information 1: 0a9e
Additional Information 2: 0a9e372d3b4ad19135b953a78882e789
Additional Information 3: 0a9e
Additional Information 4: 0a9e372d3b4ad19135b953a78882e789
为什么会这样?