public function inc(){
$num = trim($_POST['num']);
$data=$this->db->limit($num,3)->get('catalogue');
foreach ($data-> result() as $new){
echo '<div class="news-item_indx">';
echo ' <div class="news-cont_indx"><a href="">'.$new->title.'</a></div>';
echo ' <div class="news-date_indx">'.$new->date.'</div>';
echo '</div>';
}
}
echo $data['query']=$this->db->limit($num,3)->get('catalogue');
success: function(response){
if(response){
$('#result').html(response);
}
var num = 5;
$(function() {
$("#more").click(function(){
$.ajax({
url: "<?php echo base_url(); ?>" + "index.php/main/inc",
type: "POST",
data: {"num": num},
cache: false,
success: function(response){
if(response == 0){
$("#divsept").append(response);
}
});
});
});
$num = trim($_POST['num']);
$data['query']= $this->db->limit($num,3)->get('catalogue');
$this-> load-> view('main_view', $data);