#Forgetting the length of the string in bits, you can use the MySQL BIT_LENGTH() string function. Its syntax is BIT_LENGTH(Str).
Here, the parameter Str of the BIT_LENGTH() function is the string whose BIT_LENGTH value is to be retrieved. Str can be a string or a numeric string. If it is a string it must be enclosed in quotes.
mysql> Select BIT_LENGTH('tutorialspoint'); +------------------------------+ | BIT_LENGTH('tutorialspoint') | +------------------------------+ | 112 | +------------------------------+ 1 row in set (0.00 sec) mysql> Select BIT_LENGTH(2365489); +---------------------+ | BIT_LENGTH(2365489) | +---------------------+ | 56 | +---------------------+ 1 row in set (0.00 sec)
The above is the detailed content of What is the purpose of the MySQL BIT_LENGTH() function?. For more information, please follow other related articles on the PHP Chinese website!