The sql_multi()
function applies an SQL expression to a column that contains a multi-lingual expression (<multi>
) in order to extract from it the portion corresponding to a nominated language. It returns a character string typed as: expression AS multi
. This operation is essentially used to simultaneously request a sort on this column.
It accepts 4 parameters:
-
$sel
is the name of the column, -
$lang
is the language code (’fr’, ’es’, ...), -
$serveur
, -
$option
It is used as shown below:
$multi = sql_multi('column', 'language');
$select = sql_select($multi, 'table');
Note that in a template file, the loop criteria {par multi xx}
where xx
is the name of the column to be sorted, will also call this function in order to sort according to the current language.