{'leaf'} == true){ $leaf = 1; } else{ $leaf = 0; } if($obj->{'Duration'} == ''){ $duration = 0; } else{ $duration = $obj->{'Duration'}; } if($obj->{'parentId'} == null){ $parentID = 'NULL'; } else{ $parentID = $obj->{'parentId'}; } $q = 'UPDATE tasks SET Name = "'.$obj->{'Name'}.'", StartDate = "'.$obj->{'StartDate'}.'", EndDate = "'.$obj->{'EndDate'}.'", Duration = "'.$duration.'", DurationUnit = "'.$obj->{'DurationUnit'}.'", PercentDone = "'.$obj->{'PercentDone'}.'", Cls = "'.$obj->{'Cls'}.'", parentId = '.$parentID.', PhantomId = '.$obj->{'PhantomId'}.', PhantomParentId = '.$obj->{'PhantomParentId'}.', leaf = "'.$leaf.'" WHERE Id = "'.$obj->{'Id'}.'"'; $r = mysql_query($q); if(!$r){ echo '{"success": false, "error": "'.db_error($q).'"}'; } } echo json_encode($array); ?>