Filter subpages in while loop from WP Query object

You could even try passing 'post_parent' => 0 to the query. In your case it would be

$query->query( 'post_type=pages&post_parent=0' );

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