Tribe__Feature_Detection::mysql_limit_for_string( string $example_string )

Returns the suggested SQL LIMIT value, based on the max_allowed_packet size and example string length.

This is useful to size "reasonable" LIMITs when dealing with either very long queries or potentially long result sets.


Parameters

$example_string

(string) (Required) The example string.


Top ↑

Return

(int) The suggested LIMIT value.


Top ↑

Source

File: src/Tribe/Feature_Detection.php

	public function mysql_limit_for_string( $example_string ) {
		$byte_size = function_exists( 'mb_strlen' )
			? mb_strlen( $example_string )
			: strlen( $example_string );

		return $this->mysql_limit_for_size( $byte_size );
	}

Top ↑

Changelog

Changelog
Version Description
4.10.2 Introduced.