var ID = $(this).attr('id');
$('.show_more').hide();
$('.loding').show();
$.ajax({
type:'POST',
url:'ajax-search-demock_3.php',
data:ID,
success:function(html){
$('#show_more_main'+ID).remove();
$('.tutorial_list').append(html);
}
});
I echo’d out ID and I got the follwoing line, which is spot on - id=186&in=Cancun
But I need to change the ajax above so that Var ID only has id and say Var IN only has in, and then using POST as above to send both ID and IN, and to then collect them both as I was doing with ID in a line as below
var id = this.dataset.id;
$.post('ajax-search-demock_3.php', { id: id }, function (html) {
$('#show_more_main'+id).remove();
$('.tutorial_list').append(html);
});
And then added it to the ajax below, but not sure how I post the value
$(document).ready(function(){
$(document).on('click','.show_more',function(){
var id = this.dataset.id;
var id2 = this.dataset.id2;
$('.show_more').hide();
$('.loding').show();
$.post('ajax-search-demock_3.php', { id: id }, function (html) {
$('#show_more_main'+id).remove();
$('.tutorial_list').append(html);
});
});
});
To collect it and use it below
if(isset($_POST["id"]) && !empty($_POST["id"])){
$msg="";
$sqlAll="select COUNT(*) as num_rows from tbl_hotels LEFT JOIN tbl_resorts ON (tbl_resorts.Id_Rsrt=tbl_hotels.IdRsrt_Hot) where tbl_resorts.Nom_Rsrt like '%$in%' AND Act_Hot=1 WHERE tbl_hotels.Id_Hot < ".$_POST['id']." ORDER BY tbl_hotels.Id_Hot DESC";