I'm sorry, there's no record of your conditions.
-
I'm trying to implement the conclusion of additional articles on evidence.
Doing it.jQuery
:$(document).ready(function(){ var num = 6; $('#click').click(function(){
$.ajax({ url: "post_load.php", method: "GET", data: {"num": num} }).done(function(data){ data = jQuery.parseJSON(data); if(data.length > 0){ $.each(data, function(index, data){ $("#news").append("<div class='galon'><div class='imag'><figure class='effect-honey'>"+the_post_thumbnail+"<figcaption></figcaption></figure></div><h3>"+data.pos_title+"</h3><p>"+data.post_content+"</p></div>"); }); num += 6; } }); });
});
GET
sends it to the relevant file:require_once("db_connect.php");
$num = $_GET['num'];
$query = mysqli_query($link,"SELECT * FROM 'wp_posts' ORDER BY 'id' LIMIT {$num}, 6");
$news = array();
while($row = mysqli_fetch_array($query)){
$news[] = $row;}
echo json_encode($news);
But in the console,
404
error in filejquery.min.js
"I'm sorry, there's no record of your conditions." But there are articles, because throughWP
Six articles, all 12. I can't understand what's going on and what's wrong, please help me.
-
Transfer GET parameters to
url
♪$(document).ready(function(){ var num = 6; $('#click').click(function(){
$.ajax({ url: "post_load.php?num=" + num, method: "GET" }).done(function(data){ data = jQuery.parseJSON(data); if(data.length > 0){ $.each(data, function(index, data){ $("#news").append("<div class='galon'><div class='imag'><figure class='effect-honey'>"+the_post_thumbnail+"<figcaption></figcaption></figure></div><h3>"+data.pos_title+"</h3><p>"+data.post_content+"</p></div>"); }); num += 6; } }); });
});