protected function _prepareQuery( $table, $columns, $criteria ) {
		$where = '1 = 1';
		$params = array();
		
		foreach ( $criteria as $column => $value ) {
			$pattern = '%s';
			if ( is_null( $value ) ) {
				$pattern = '%s AND `%s` IS NULL';
			} elseif ( is_numeric( $value ) ) {
				$pattern = '%s AND `%s` = %%d';
				$params[] = $value;
			} else {
				$pattern = '%s AND `%s` = %%s';
				$params[] = $value;
			}

			$where = sprintf( $pattern, $where, $column );
		}

		if ( is_array( $columns ) ) {
			$columns = implode( ', ', $columns );
		}

		$query = sprintf( 'SELECT %s FROM %s WHERE %s', $columns, $table, $where );
		if ( ! empty( $params ) ) {
			$query = $this->_wpdb->prepare( $query, $params );
		}

		return $query;
	}