Site icon Hip-Hop Website Design and Development

The best way to run choose question of submit with class and tags?

I wish to fetch a number of posts with classes and tags
at the moment I am utilizing this question:

$pagesize = 20;
$pageNumber = 1;

$mysql = mysqli_query($con,"SELECT p.post_title,
     p.ID,
     p.post_content,
     p.post_date,
     p.post_name as url,
     t.identify as category_name
FROM wp_posts p,
     wp_terms t,
     wp_term_relationships r,
     wp_term_taxonomy tt
WHERE p.post_status='publish' AND
     tt.taxonomy = 'post_tag' AND
     p.id=r.object_id AND
     r.term_taxonomy_id=tt.term_taxonomy_id AND
     tt.term_id = t.term_id
ORDER BY p.post_date desc 
LIMIT ".(int)($pageNumber*$pageSize).",".(int)$pageSize."") or die ("error".mysqli_error($con));

The mysqli-connection works. However once I run this code, I solely get a clean web page. How can I repair this?