Query custom fields with three dates – start and end does not work

There is one issue I see in your code. Within ‘meta_query’ you cannot use ‘meta_key’, but it should be ‘key’. For example:

array(
    'key' => '_reservation_date_hour',
    'value' => $GMT_checkHour,//the value it is grab using ajax form
    'compare' => '>=',
    'type' => 'DATETIME',
)

So with your previous code all ‘meta_key’ lines were ignored. To identify such problems, I also suggest using this code:

$query = new WP_Query($args);
var_dump($query->request);
exit;

to check what WordPress makes from your arguments. This will show you the actual SQL query, which can often help to see what’s missing or what would you want to change.

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