Ejemplo n.º 1
0
 public static function addForesttype($obj_Foresttype)
 {
     $db = config::dbconfig();
     $obj_retresult = new returnResult();
     $obj_Foresttype->ForestTypeId = DAL_manageForesttype::getLastForesttypeId() + 1;
     $sql = "INSERT INTO tbl_foresttype (ForestTypeId,Name,Description) \n\t\tVALUES (" . common::noSqlInject($obj_Foresttype->ForestTypeId) . "," . "'" . common::noSqlInject($obj_Foresttype->Name) . "'" . "," . "'" . common::noSqlInject($obj_Foresttype->Description) . "'" . ");";
     $rs = mysql_query($sql);
     if (mysql_affected_rows() > 0) {
         $obj_retresult->type = 1;
         $obj_retresult->msg = "success";
         $obj_retresult->data = $obj_Foresttype;
     } else {
         $obj_retresult->type = 0;
         $obj_retresult->msg = "failed";
     }
     return $obj_retresult;
 }