I'm using an ajax call to query a database. I'd like to pass a complex sql query as part of the ajax data. Is this the way I should be doing it?
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
}
});