v5:reference:connection:length
This is an old revision of the document!
length
Syntax
string length(string columnName)
Description
The method length() returns a database specific SQL statement that returns the length of data in a field. This happens even if the field is defined as a fixed length CHAR field, because the field is trimmed before the length of the data is obtained.
Usage
/* * Assume MySQL database */ $sql = $db->length(some_string_field); /* * Returns: LENGTH(TRIM(some_string_field); */
/* * Assume Firebird database */ $sql = $db->length(some_string_field); /* * Returns: CHAR_LEN(TRIM(some_string_field); */
v5/reference/connection/length.1770412535.txt.gz · Last modified: by mnewnham
