Collections functions
Encryption functions
General functions
Theme permission functions
Resource functions

clear_resource_data()

Parameters

ColumnTypeDefaultDescription
$resource

Location

include/resource_functions.php lines 2966 to 2988

Definition

 
function clear_resource_data($resource)
    {
    
# Clears stored data for a resource.
    
sql_query("delete from resource_data where resource='$resource'");
    
sql_query("delete from resource_dimensions where resource='$resource'");
    
sql_query("delete from resource_keyword where resource='$resource'");
    
sql_query("delete from resource_related where resource='$resource' or related='$resource'");
    
delete_all_resource_nodes($resource); 
    
    
// Clear all 'joined' fields
    
$joins=get_resource_table_joins();
    if(
count($joins) > 0)
        {
        
$joins_sql "";
        foreach (
$joins as $join)
            {
            
$joins_sql .= (($joins_sql!="")?",":"") . "field" escape_check($join) . "=NULL";
            }
        
sql_query("UPDATE resource SET $joins_sql WHERE ref='$resource'");
        }
        
    return 
true;
    }

This article was last updated 10th July 2020 22:05 Europe/London time based on the source file dated 10th July 2020 16:06 Europe/London time.