jQuery issue here.

After calling some ajax, I'm having a problem getting a particular div to reload a php file. The only solution that I've come up with is to completely reload the page, but this is really undesirable, because this function is being used as part of a simple sort page.

So in the below code where it says location.reload() I would much prefer it to say something like $("#mydiv").load("phpfile.php"), so that it just loads the file into the div. This .load() actually does connect to the php file, but for some reason phpfile.php cannot finish the MySQL query it's trying to execute.

So the questions are:

1) Is there an easier way to do this than using .load()?


2) If there isn't, why isn't the php file/MySQL query working properly?

function sorter(event){

	var order = $("#sortable").sortable('toArray');
	url: "sorter.php",
	async: false,
	data: {'id[]': order},
	complete: (function(data){

Well, it looks like it was easier to run phpfile.php from sorter.php, and then put the data into #mydiv using $("#mydiv").html(data).