how to check for wordpress Query errors

A good pointer would be to enable debugging in WordPress. Add this to your wp-config.php: define( 'WP_DEBUG', true );.

By default WordPress does not show much debug information. More on this here.