/**
  * Executes a SQL query and returns a reference to the result set.
  *
  * @param sql
  * @return 
  */
 public function query($sql)
 {
     if (Configuration::isDebug()) {
         echo $sql . "<br>";
     }
     $this->sql = $sql;
     if ($this->isPagination()) {
         $sql .= $this->getSQLLimitString();
     }
     try {
         if ($this->transaction) {
             return mysql_query($sql, $this->link);
         } else {
             return mysql_query($sql, $this->link);
         }
     } catch (Exception $e) {
         return false;
         die("BCH_Database.query.bom: Error in SQL query: " . $this->error() . " Exception : " . $e->getMessage());
     }
 }