+ $post_where .= $wpdb->prepare( 'comment_post_ID = %d AND ', $post_id );
+ if ( '' !== $author_email )
+ $post_where .= $wpdb->prepare( 'comment_author_email = %s AND ', $author_email );
+ if ( '' !== $karma )
+ $post_where .= $wpdb->prepare( 'comment_karma = %d AND ', $karma );
+ if ( 'comment' == $type )
+ $post_where .= "comment_type = '' AND ";
+ elseif ( ! empty( $type ) )
+ $post_where .= $wpdb->prepare( 'comment_type = %s AND ', $type );
+ if ( '' !== $parent )
+ $post_where .= $wpdb->prepare( 'comment_parent = %d AND ', $parent );
+ if ( '' !== $user_id )
+ $post_where .= $wpdb->prepare( 'user_id = %d AND ', $user_id );