I'm wondering how can I do to click a button and onclick this button I call a php function, they said that I have to use ajax, however I do not have ajax knowledge but I'm going to study, could you help me?
<button id="loadmore" onclick="<?php queryRetorno($limite*2);?>">Carregar
Mais</button>
I tried this way but it did not work, basically what I want is to increase the query sql limit every time the button is clicked, here is the query query function
function queryRetorno($limite){
$sql = mysql_query("SELECT DISTINCT wposts.*,(SELECT meta_value FROM
wp_7_postmeta WHERE meta_key='_wp_attached_file' and post_id = (SELECT
meta_value FROM wp_7_postmeta WHERE meta_key='_thumbnail_id' and
wp_7_postmeta.post_id= wposts.ID limit 1)) as imagem
FROM wp_7_posts wposts
LEFT JOIN wp_7_postmeta wpostmeta ON wposts.ID = wpostmeta.post_id
LEFT JOIN wp_7_term_relationships ON (wposts.ID =
wp_7_term_relationships.object_id)
LEFT JOIN wp_7_term_taxonomy ON (wp_7_term_relationships.term_taxonomy_id =
wp_7_term_taxonomy.term_taxonomy_id)
where 'post_type'='post' and post_status ='publish'
LIMIT {$limite}");
carregaImagem($sql);
return $limite;
}