0

$per_page    = 500;
if(!empty($_GET['per_page']))
{
 $per_page =$_GET['per_page'];
}
//$offset      = $per_page * ($currentPage - 1) ;
$offset  =0;
if(!empty($_GET['offset'])){
 $offset =$_GET['offset'];
}
  $query =  "SELECT  name FROM  ".$wpdb->prefix."terms wpt  JOIN ".$wpdb->prefix."term_taxonomy as wtt WHERE  1 = 1 AND wpt.term_id = wtt.term_id AND wtt.taxonomy = 'post_tag' AND wpt.name LIKE '$elements1%' AND wtt.count >10 ORDER BY wpt.term_id DESC LIMIT ".$offset. ", ".$per_page;
  $records = $wpdb->get_results($query);
 if(!empty($records)){
 foreach ($records as $t) {
        $a[]= $t->name;
}

Jagdish Sarma Asked question March 7, 2023
Add a Comment