Q:

PHP OOP query is not executing

I am using PHP with OOP to select rows from the database (MySQL). 
When I execute the query, it returns an empty row. 
Here is the classe I am using:
<? php 
class EmploiManager
{
 private $_db; 

 public function __construct($db)
 {
   $this->setDb($db);
 }
 public function category($category)
 {
   $q = $this->_db->prepare('SELECT * FROM DemandeEmploi WHERE category = :category');
   $q->execute(array('category' =>$category));
   $donnees = $q->fetch(PDO::FETCH_ASSOC);
   return new Emploi($donnees);
 }

 public function setDb(PDO $db)
 {
  $this->_db = $db;
 }
} 

$type = $_GET['category'];
$manager = new EmploiManager($db);
$row = $manager->category($type);

foreach ($row as $demandeE) 
{
  ? > 
    <div class="list"><h4><a href="?id=<?  echo $demandeE->id();?>&category=demandemploi"><?  echo $demandeE->title();?></a></h4> </div>      
    <? php
       } 
   ? >

Can any one tell me what's wrong with that code?  
Thanks! 

A:

It's my bad, I didn't use a loop to select all the rows. 
I corrected the code and it works fine now, here is what it looks like:
public function category($category)
{
  $datas = array();

  $q = $this->_db->prepare('SELECT * FROM DemandeEmploi WHERE category = :category');
  $q->execute(array('category' =>$category));

  while ($donnees = $q->fetch(PDO::FETCH_ASSOC)) 
  {
    $datas[] = new Emploi($donnees);
  }
  return $datas;

}

