Saturday, December 5th, 2009 (updated 26 Apr ’15)

Documentation for External Entries v2.6.4

 
  • Version
    2.6.4
  • Type
    Plugins
  • More info
  • Elsewhere
    "EE Forums thread":http://expressionengine.com/forums/viewthread/145112/ "Devot-ee page":http://devot-ee.com/add-ons/plugins/external-entries/ "Programattically/automatically adding weblog entries":http://expressionengine.com/forums/viewthread/145382/
  • Download

Delete

h2(#delete-function). Parameters for exp:external_entries:delete h3. Required parameters h4. debug= The default value for the debug parameter is "yes". This is a safety measure to avoid inadvertently deleting data mistakenly. When debug is on, the plugin does not do the delete. Instead, the SQL query and any error messages are displayed within a div of class "delete-entries-message". To activate the plugin, set debug to "no". h4. table= The required table parameter tells the plugin from which database table to delete. h3. Optional parameters h4. connection= Set to "persistent" if using an external database and EE's database settings are for non-persistent connections. h4. database= The database parameter is required only if deleting from a table on an external database. In this scenario the hostname, password and username parameters are also required. h4. hostname= The hostname parameter is required only if deleting from a table on an external database. In this scenario the database, password and username parameters are also required. h4. limit= If the limit parameter is not set, the default value is "1". This is a safety measure to minimize the damage done by any inadvertent data deletions. h4. parse= The parse parameter is common for all plugins. Setting its value to "inward" allows the plugin to contain another plugin. Using this requires adding a closing tag for the plugin, which otherwise isn't necessary. h4. password= The password parameter is required only if deleting from a table on an external database. In this scenario the database, hostname and username parameters are also required. h4. search:[column_name]= The search:[column_name] parameter limits the deletion to only those rows in the table where the value of the specified column is equal to the value entered. To search for multiple results within one column, separate each value with a pipe, ie, search:my_column="my text|my other text". Any number of search:[column_name] parameters may be used; they are connected by an "and" boolean operator. These parameters form the part of the SQL query following "WHERE". h4. username= The username parameter is required only if deleting a table on an external database. In this scenario the database, hostname and password parameters are also required. h2. Variables for exp:external_entries:delete There are no variables for this function. h2. Examples for exp:external_entries:delete To delete weblog content on the current ExpressionEngine database (there is no need for a closing tag):
{exp:external_entries:delete table="exp_weblog_titles" search:entry_id="{entry_id}" debug="n"}
{exp:external_entries:delete table="exp_weblog_data" search:entry_id="{entry_id}" debug="n"}
To delete weblog entries fields based on fields requires knowing the actual column name of the field being updated. All weblog fields are in the format "field_id_[xx]", such as field_id_40. One easy way to find this value is to look at the query string of the URL when editing a field. At the end of the URL's query string is the field_id -- the value here is the number we seek. To delete from a table on an external database:
{exp:external_entries:delete
	hostname="www.cia.gov" 
	database="enemies" 
	username="felix_leiter" 
	password="alimentary" 
	table="enemies_leaders" 
	search:leaders_name="Ernst Stavro Blofeld" 
	debug="n"
}

Post a comment

Name:

Email:

Location:

URL:

Your comment:

Remember my personal information
Notify me of follow-up comments?

Please enter the word you see in the image below: