示例#1
0
 /**
  * bool update(string $tableName, Description $des)
  *
  * Update a row in a domain table.
  *
  * @param string $tableName table name of domain table to query
  * @param Description $des row to update
  * @return boolean returns false, if error occurs
  * @access public
  */
 function update($tableName, $des)
 {
     if (!$des instanceof Description) {
         $this->_error = "Argument is an inappropriate object.";
         return false;
     }
     $sql = "UPDATE " . $tableName . " SET ";
     $sql .= "description='" . urlencode($des->getDescription()) . "' ";
     if ($tableName == "profile_tbl") {
         $sql .= "WHERE id_profile=" . $des->getCode();
     }
     return $this->exec($sql);
 }