public static function addVillage_history($obj_Village_history) { $db = config::dbconfig(); $obj_retresult = new returnResult(); $obj_Village_history->TblId = DAL_manageVillage_history::getLastVillage_historyId() + 1; $sql = "INSERT INTO tbl_village_history (TblId,VillageId,DescriptionType,Description) \n\t\tVALUES (" . common::noSqlInject($obj_Village_history->TblId) . "," . common::noSqlInject($obj_Village_history->VillageId) . "," . "'" . common::noSqlInject($obj_Village_history->DescriptionType) . "'" . "," . "'" . common::noSqlInject($obj_Village_history->Description) . "'" . ");"; $rs = mysql_query($sql); if (mysql_affected_rows() > 0) { $obj_retresult->type = 1; $obj_retresult->msg = "success"; $obj_retresult->data = $obj_Village_history; } else { $obj_retresult->type = 0; $obj_retresult->msg = "failed"; } return $obj_retresult; }