Pass your x
object as param to update function..
<a class="button button-info" ng-click="update(x)">Update</a>
$scope.update = function(x){
$http.post("http://localhost/deb/update.php",
{
'Code' :x.Code,
}
).success(function(data){
alert(data);
$scope.thisX = $state.params.Num;
});
}