Collections functions
Encryption functions
General functions
Theme permission functions
Resource functions

get_grouped_related_keywords()

Parameters

ColumnTypeDefaultDescription
$find ""
$specific ""

Location

include/search_functions.php lines 2289 to 2305

Definition

 
function get_grouped_related_keywords($find="",$specific="")
    {
    
debug_function_call("get_grouped_related_keywords"func_get_args());

    
# Returns each keyword and the related keywords grouped, along with the resolved keywords strings.
    
$sql="";
    if (
$find!="") {$sql="where k1.keyword='" escape_check($find) . "' or k2.keyword='" escape_check($find) . "'";}
    if (
$specific!="") {$sql="where k1.keyword='" escape_check($specific) . "'";}
    
    return 
sql_query("
        select k1.keyword,group_concat(k2.keyword order by k2.keyword separator ', ') related from keyword_related kr
            join keyword k1 on kr.keyword=k1.ref
            join keyword k2 on kr.related=k2.ref
        
$sql
        group by k1.keyword order by k1.keyword
        "
);
    }

This article was last updated 7th July 2020 09:05 Europe/London time based on the source file dated 24th June 2020 15:23 Europe/London time.