I wast some hours searching solutions for my issue and I couldn't find an answer.
I'm making a search on same page and for that, I'm using Jquery, AJAX and PHP.
The array from php still return undefined.
PHP code:
$i=0;
while($eee = mysqli_fetch_array($result)) {
$array[$i][1] = $eee['ex'];
$array[$i][2] = $eee['ex'];
$array[$i][3] = $eee['ex'];
$array[$i][4] = $eee['ex'];
$array[$i][5] = $eee['ex'];
$array[$i][6] = $eee['ex'];
$array[$i][7] = $eee['ex'];
$i = $i + 1;
}
json_encode($array)
AJAX and JQUERY
jQuery(document).ready(function(){
$(document).on('submit', '#FormData', function(e) {
$.ajax({
url: $(this).attr('action'),
type: $(this).attr('method'),
data: $(this).serialize(),
success: function(data) {
console.log(data[1]);
}
});
e.preventDefault();
});
});
Thanks for any help here ;)