By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,747 Members | 2,039 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,747 IT Pros & Developers. It's quick & easy.

Segmentation fault if I call this more than one time

P: n/a
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;
}
Jul 16 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.