title: Resource Id #14
body: <p>I want to display information from multiple rows. Without changing the majority of my code, how can I echo the multiple rows on my webpage that have <code>user_id_offerer</code> = '$offerer'. I did echo the mysql query and I got the result of Resource Id #14 and I understand a while loop is necessary, but it seems like there is a problem with mysql. How do I fix this?</p>
  
  <p>Clarification: When I ran the code with the while loop, I received an infinite loop of the first row. I did not receive each individual row that had <code>user_id_offerer</code> = 'offerer'. How do I fix this without having to do a major re-write of the code.</p>
  
  <pre><code>function ergo_data ($offerer) {
  
    $data = array();
    $offerer = (int)$offerer;
  
    $func_num_args = func_num_args(); 
    $func_get_args = func_get_args();
  
    if ($func_num_args &gt; 1) {
            unset($func_get_args[0]);
        $fields ='`' .  implode ('`, `', $func_get_args) . '`';
        $data = mysql_fetch_assoc (mysql_query("SELECT $fields FROM `ergo` WHERE `user_id_offerer` = '$offerer'"));
        return $data;
    }
  }
  
  if (logged_in() === true) { 
    $session_user_id = $_SESSION['user_id'];
    $ergo_data = ergo_data($session_user_id, 'primary_key', 'user_id_offerer', 'user_id_seeker', 'ergo', 'ergo_time_submitted');
  }
  
  echo $ergo_data['ergo'] . '&lt;br&gt;'; 
  echo username_from_user_id($ergo_data['user_id_offerer']) . '&lt;br&gt;'; 
  echo username_from_user_id($ergo_data['user_id_seeker']) . '&lt;br&gt;'; 
  echo $ergo_data['ergo_time_submitted'];`
  </code></pre>