Hi there,
If I call mergeProfiles() only one time, it is fine. However, if I
call it more than one time (say twice), then it will returns a
segmentation fault... any ideas?
$res is a result of a call to mysql_query()
function mergeProfiles($res) {
$merge = mergeRes($res);
$profiles = array();
foreach($merge as $key=>$value) {
array_push($profiles, new Profile($value));
}
return $profiles;
}
function mergeRes($res) {
$p_infos = array();
while($data = mysql_fetch_object($res)) {
if (!isset($p_infos[$data->alias])) {
$p_infos[$data->alias] = array();
}
array_push($p_infos[$data->alias], $data);
}
return $p_infos;
}