public static function addLocation($obj_Location) { $db = config::dbconfig(); $obj_retresult = new returnResult(); $obj_Location->LocationId = DAL_manageLocation::getLastLocationId() + 1; $sql = "INSERT INTO tbl_location (LocationId,Name,LocationType,Description) \n\t\tVALUES (" . common::noSqlInject($obj_Location->LocationId) . "," . "'" . common::noSqlInject($obj_Location->Name) . "'" . "," . "'" . common::noSqlInject($obj_Location->LocationType) . "'" . "," . "'" . common::noSqlInject($obj_Location->Description) . "'" . ");"; $rs = mysql_query($sql); if (mysql_affected_rows() > 0) { $obj_retresult->type = 1; $obj_retresult->msg = "success"; $obj_retresult->data = $obj_Location; } else { $obj_retresult->type = 0; $obj_retresult->msg = "failed"; } return $obj_retresult; }