我正在使用 ajax 调用来查询数据库。我想将复杂的 sql 查询作为 ajax 数据的一部分传递。这是我应该这样做的方式吗?
var myQuery = 'select * from table....';
$.ajax({
type: "GET",
url: 'jsonQuery.php',
dataType: 'json',
data: {keyvalue: 2416, q: myQuery},
success: function(pieData) {
//do something with the response
}
});