Hope you all fine.I am facing some sort of problem while passing multiple parameters through $.get().
I want to pass “coord.left” and “coord.top” coordinates of a drag-able object through $.get() so I can store these coords into my databse.
When I am passing a single parameter it is working fine but facing problem while passing multiple values.
Here is my code:
.mouseup(function(){
var coords=[];
var coord = $(this).position();
var item={ coordTop: coord.top, coordLeft: coord.left };
coords.push(item);
var order = { coords: coords };
$.get('updatecoords.php', 'left='+coord.left, 'top='+coord.top function(response){
alert("Data Loaded: " + coord.left + coord.top);
});
});
});
and here is my updatecoords.php file where I am pushing these values into database:
$xleft = $_GET["left"];
$ytop = $_GET["top"];
//update query
$sql = "UPDATE coords SET x_pos = '$xleft', y_pos = '$ytop'";
What’s about
or