Segmentation fault if I call this more than one time

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Sébastien

    Segmentation fault if I call this more than one time

    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($pro files, new Profile($value) );
    }
    return $profiles;
    }


    function mergeRes($res) {

    $p_infos = array();
    while($data = mysql_fetch_obj ect($res)) {

    if (!isset($p_info s[$data->alias])) {
    $p_infos[$data->alias] = array();
    }
    array_push($p_i nfos[$data->alias], $data);
    }

    return $p_infos;
    }
Working...