That's unusual; you shouldn't be getting a query is empty from this.
You should be able to verify this by modifying this:
$result = mysql_query($order);
$result = mysql_query($order) or die('Failed to execute query: ' . $order . ', error: ' . mysql_error());
. I'm not going to lie, I'm not convinced that the problem is here.
BTW, if you don't see that error string in the die, then the problem is not here. If you do, post that in its entirety.