I have the javascript code that returns me in a variable 'msg' the result of a query made in PHP.
var page = "busca.php";
$.ajax({
type: 'POST',
dataType: 'html',
url: page,
data: {idtabela: idtabela},
success: function (msg) {
//preciso transferir os dados no formato json par ao php
msg = $.parseJSON(msg);
}
});
This data is json format, I need to transfer it to another php file. To be more precise, I'm using the DataTables plugin. In it I already loop a sql query in the database. Now I need to give the user the option on which table he wants to query, thus changing the query with each click. I thought of doing in the file where the table is, a variable that receives the json and throw in the DataTables