How can I display a query in a page?

You can use the $wpdb object

// Print last SQL query string
$wpdb->last_query

or:

<?php
  if (current_user_can('administrator')){
    global $wpdb;
    echo "<pre>";
    print_r($wpdb->queries);
    echo "</pre>";
  }//Lists all the queries executed on your page
?>

You might have to set define('SAVEQUERIES', true); in wp-config.php

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)