Collections functions
Encryption functions
General functions
Theme permission functions
Resource functions

relate_to_collection()

Parameters

ColumnTypeDefaultDescription
$ref
$collection

Location

include/collections_functions.php lines 1902 to 1908

Definition

 
function relate_to_collection($ref,$collection)    
    {
    
# Relates every resource in $collection to $ref
        
$colresources get_collection_resources($collection);
        
sql_query("delete from resource_related where resource='" escape_check($ref) . "' and related in ('" join("','",$colresources) . "')");  
        
sql_query("insert into resource_related(resource,related) values (" escape_check($ref) . "," join("),(" $ref ",",$colresources) . ")");
    }    

This article was last updated 5th July 2020 04:35 Europe/London time based on the source file dated 3rd July 2020 14:33 Europe/London time.