I wanna get and handle the data from a POST request.
I got the code:
function GetSqlResult (sql_query) {
var result = [];
$.post("getsqlresult.php", {
sql: sql_query
},
function(data){
result.push(data);
});
return result;
};
I get the error "result.append(data) is not a function".
I don't know if that what I'm doing is possible, but I wanna collect the data in an array.
This "could be" a duplicate from "Data from post request" , but it didn't work with the responses from that question, that's why I'm asking with my own code.