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 2576 to 2581

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 11th May 2021 11:35 Europe/London time based on the source file dated 10th May 2021 09:15 Europe/London time.