this is a code excerpt I had laying around:
$query = "SELECT contact FROM Contacts WHERE user = " . $this->id;
$result = mysql_query($query, $this->link);
if(!$result)
throw new MySQLException("MySQL Error: " . mysql_error(), $query);
$this->contactIDs = array();
while($row = @mysql_fetch_array($result))
array_push($this->contactIDs, $row[0]); and it works fine. If I get a chance Friday, I'll try to look through your code again...