Answer the question
In order to leave comments, you need to log in
Is it possible to do two outputs for AJAX in one php script?
For example, display orders from 2 tables at a time.
echo json_encode(array("ordersprint" => $orders_print));
echo json_encode(array("ordersdesign" => $orders_design));
success: function(json){
$.each(json.ordersprint,function() {
......
$.each(json.ordersdesign,function() {
......
}
Answer the question
In order to leave comments, you need to log in
echo json_encode(array("ordersprint" => $orders_print, "ordersdesign" => $orders_design));
//each можно оставить тогда без указаний на имя индекса
$.each(json,function() {});
//или обратиться так без each
json[0] //or json['ordersprint']
json[1] //or json['ordersdesign']
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question