Collections functions
Encryption functions
General functions
Render functions
Theme permission functions
Video functions
Resource functions

relate_to_collection()

Description

Relates every resource in $collection to $ref

Parameters

ColumnTypeDefaultDescription
$ref integer
$collection integer

Return

void

Location

include/collections_functions.php lines 2395 to 2400

Definition

 
function relate_to_collection($ref,$collection)    
    {
    
$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 30th November 2020 16:35 Europe/London time based on the source file dated 25th November 2020 10:35 Europe/London time.