Q:

IN Clause return only 1 row

I have a list of links and titles in my links table and I'm trying to use an IN clause to return them but the query never returns more than a single row, and always the min row of the set. 
SELECT title, url 
FROM opsx_links 
WHERE linkid IN('61','60','10','24','15','20','30','47')

This should return all 8 links as they do all exist, but it only return the info for item 10.  If I remove item 10 form the list, it will then only return item 15 and so on. 
Am I losing it or what? 
I've Googled my butt off and can't find anyone that's had this issue. 
Thanks. 
-V
ok my bad here's the php code
public function getLinks ($data) {
   $query  = $this->db->Fetch ("SELECT title, url 
             FROM {$this->prefix}links WHERE linkid IN(" .  $data . ")"); 
   $result = $this->db->FetchObject ($query);

   foreach ($result as $key => $value):

      $result->$key = $this->replace_strings ($value);

   endforeach;

   $this->db->Free ($query);

   return $result;
}

Tried this per jeron
$res = array();

while ($result = $this->db->FetchObject ($query)):

    $res['title'] = $result->title;
    $res['url']   = $result->url;

endwhile;

Now only the first row is returned instead of the minimum row. 
What in the world? 
Ok after much trial and error and help from all you gurus, here's the answer. 
public function getLinks ($data) {
     $query  = $this->db->Fetch ("SELECT title, url 
               FROM {$this->prefix}links WHERE linkid IN(" .  $data . ")");   
     $res = array ();
     while ($results = $this->db->FetchArray ($query)):
          $obj = new stdClass;
          $obj->title = $results['title'];
          $obj->url = $this->replace_strings($results['url']);
          $res[] = $obj;
     endwhile;

     $this->db->Free ($query);

     return (object)$res;
}

Thanks for the help. 

A:

Edit: You are only getting one result from the results set:
$result = $this->db->FetchObject ($query);

Should be something like:
$my_results = array();
while ($result = $this->db->FetchObject ($query))
{
  // make a new / clone the object, add it to the array and do the processing
}
return $my_results;

