<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://docs.sandbox.joomla.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Adrian</id>
	<title>Joomla! Documentation - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://docs.sandbox.joomla.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Adrian"/>
	<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/Special:Contributions/Adrian"/>
	<updated>2026-05-15T03:23:25Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=SQL_form_field_type&amp;diff=672507</id>
		<title>SQL form field type</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=SQL_form_field_type&amp;diff=672507"/>
		<updated>2020-05-31T11:26:53Z</updated>

		<summary type="html">&lt;p&gt;Adrian: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&amp;lt;languages /&amp;gt;&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
{{Warning|&amp;lt;translate&amp;gt;&amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
Using this generic form field type forces you to write SQL in an XML file and is rather limited. For more flexibility, consider creating your own, specific form field type by subclassing the JFormField class.&amp;lt;/translate&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
The &#039;&#039;&#039;sql&#039;&#039;&#039; form field type provides a drop down list of entries obtained by running a query on the Joomla database. If the field has a value saved, this value is selected when the page is first loaded. If not, the default value (if any) is selected.&amp;lt;/translate&amp;gt;&lt;br /&gt;
[[Image:Params.sql.jpg|right]]&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;type&#039;&#039;&#039; (mandatory) must be &#039;&#039;sql&#039;&#039;.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;name&#039;&#039;&#039; (mandatory) is the unique name of the field. This must match the name of the query results column that contains the values that will be shown to the user in the drop-down list, unless a different name is specified in the &#039;&#039;&#039;value_field&#039;&#039;&#039; attribute.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;label&#039;&#039;&#039; (mandatory) (translatable) is the descriptive title of the field.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;query&#039;&#039;&#039; (mandatory if not using the sql_* attributes) is the SQL query which will provide the data for the drop-down list. The query must return two columns; one called &#039;&#039;&amp;lt;nowiki&amp;gt;&#039;value&#039;&amp;lt;/nowiki&amp;gt;&#039;&#039; (unless overridden by the &#039;&#039;&#039;key_field&#039;&#039;&#039; attribute) which will hold the values of the list items; the other called the same as the value of the name attribute (unless overridden by the &#039;&#039;&#039;value_field&#039;&#039;&#039; attribute) containing the text to be shown in the drop-down list.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;default&#039;&#039;&#039; (optional) is the default value. This is the value of the &#039;&#039;&amp;lt;nowiki&amp;gt;&#039;value&#039;&amp;lt;/nowiki&amp;gt;&#039;&#039; column, unless overridden by the &#039;&#039;&#039;key_field&#039;&#039;&#039; attribute.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;description&#039;&#039;&#039; (optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.&amp;lt;/translate&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;multiple&#039;&#039;&#039; (optional) turns the field into a multi-selector. Use multiple=&amp;quot;multiple&amp;quot;.&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;key_field&#039;&#039;&#039; (optional) is the name of the column that will contain values for the parameter. If omitted then the column called &#039;&#039;&amp;lt;nowiki&amp;gt;&#039;value&#039;&amp;lt;/nowiki&amp;gt;&#039;&#039; will be used, if it exists.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;value_field&#039;&#039;&#039; (optional) is the name of the column that will contain values to be shown to the user in the drop-down list. If omitted then the column with the same name as the name attribute will be used, if it exists.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;translate&#039;&#039;&#039; (optional) will translate the output of the &#039;&#039;&#039;value_field&#039;&#039;&#039; if set to true. It defaults to false.&amp;lt;/translate&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;header&#039;&#039;&#039; (optional) (translatable) will add an entry, with an empty value, at the top of the list of options.  This is usually used to add a &#039;&#039;&amp;quot;- Select something -&amp;quot;&#039;&#039; entry to the list.  See the examples for an alternative way of achieving this.&lt;br /&gt;
* &#039;&#039;&#039;sql_select&#039;&#039;&#039; (mandatory if not using the &#039;&#039;&#039;query&#039;&#039;&#039; attribute) is the SELECT clause of the SQL statement.  Only one such clause is permitted.&lt;br /&gt;
* &#039;&#039;&#039;sql_from&#039;&#039;&#039; (mandatory if not using the &#039;&#039;&#039;query&#039;&#039;&#039; attribute) is the FROM clause of the SQL statement.&lt;br /&gt;
* &#039;&#039;&#039;sql_join&#039;&#039;&#039; (optional) is the LEFT JOIN clause of the SQL statement.  Only one such clause is permitted.&lt;br /&gt;
* &#039;&#039;&#039;sql_where&#039;&#039;&#039; (optional) is the WHERE clause of the SQL statement.  Only one such clause is permitted.&lt;br /&gt;
* &#039;&#039;&#039;sql_group&#039;&#039;&#039; (optional) is the GROUP BY clause of the SQL statement.&lt;br /&gt;
* &#039;&#039;&#039;sql_order&#039;&#039;&#039; (optional) is the ORDER BY clause of the SQL statement.&lt;br /&gt;
* &#039;&#039;&#039;sql_filter&#039;&#039;&#039; (optional) filters the list by the value of another field.  A field name or a comma-separated list of field names can be given.  The field names must correspond to column names in the database table being queried.  See the examples for further explanation.&lt;br /&gt;
* &#039;&#039;&#039;sql_default_{FIELD_NAME}&#039;&#039;&#039; (optional) is the default value used by the &#039;&#039;&#039;sql_filter&#039;&#039;&#039; attribute when the value of the &#039;&#039;{FIELD_NAME}&#039;&#039; filter has not been set.  See the examples for further explanation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
Example XML parameter definition:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;field&lt;br /&gt;
    name=&amp;quot;title&amp;quot;&lt;br /&gt;
    type=&amp;quot;sql&amp;quot;&lt;br /&gt;
    default=&amp;quot;10&amp;quot;&lt;br /&gt;
    label=&amp;quot;Select an article&amp;quot;&lt;br /&gt;
    query=&amp;quot;SELECT id AS value, title AS text FROM #__content&amp;quot;&lt;br /&gt;
    /&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
Notice that an AS clause has been used in this example because the &#039;&#039;jos_content&#039;&#039; table does not have a column called &#039;&#039;&amp;lt;nowiki&amp;gt;&#039;value&#039;&amp;lt;/nowiki&amp;gt;&#039;&#039;.  In fact very few tables in the Joomla database have a column called &#039;&#039;&amp;lt;nowiki&amp;gt;&#039;value&#039;&amp;lt;/nowiki&amp;gt;&#039;&#039;.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
Alternatively, you can use a &#039;&#039;&#039;key_field&#039;&#039;&#039; attribute to define the column to be used instead of &#039;&#039;&amp;lt;nowiki&amp;gt;&#039;value&#039;&amp;lt;/nowiki&amp;gt;&#039;&#039;:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;field&lt;br /&gt;
    name=&amp;quot;title&amp;quot;&lt;br /&gt;
    type=&amp;quot;sql&amp;quot;&lt;br /&gt;
    default=&amp;quot;10&amp;quot;&lt;br /&gt;
    label=&amp;quot;Select an article&amp;quot;&lt;br /&gt;
    query=&amp;quot;SELECT id, title FROM #__content&amp;quot;&lt;br /&gt;
    key_field=&amp;quot;id&amp;quot;&lt;br /&gt;
    /&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
This will give identical results to the previous example.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
Both column names may need to be aliased.  For example, suppose you want your field to be called &#039;&#039;&amp;lt;nowiki&amp;gt;&#039;myfield&#039;&amp;lt;/nowiki&amp;gt;&#039;&#039; instead of &#039;&#039;&amp;lt;nowiki&amp;gt;&#039;title&#039;&amp;lt;/nowiki&amp;gt;&#039;&#039; in the previous example.  Then you can do this:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;field&lt;br /&gt;
    name=&amp;quot;myfield&amp;quot;&lt;br /&gt;
    type=&amp;quot;sql&amp;quot;&lt;br /&gt;
    default=&amp;quot;10&amp;quot;&lt;br /&gt;
    label=&amp;quot;Select an article&amp;quot;&lt;br /&gt;
    query=&amp;quot;SELECT id AS value, title AS myfield FROM #__content&amp;quot;&lt;br /&gt;
    /&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
Or alternatively:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;field&lt;br /&gt;
    name=&amp;quot;myfield&amp;quot;&lt;br /&gt;
    type=&amp;quot;sql&amp;quot;&lt;br /&gt;
    default=&amp;quot;10&amp;quot;&lt;br /&gt;
    label=&amp;quot;Select an article&amp;quot;&lt;br /&gt;
    query=&amp;quot;SELECT id, title FROM #__content&amp;quot;&lt;br /&gt;
    key_field=&amp;quot;id&amp;quot;&lt;br /&gt;
    value_field=&amp;quot;title&amp;quot;&lt;br /&gt;
    /&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
You can also assemble or calculate fields in the SQL statement.  For example, suppose you wanted to append the created date/time of each article to the article title in the list.  Then you could use this SQL statement:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
SELECT id, concat( title, &#039; (&#039;, created, &#039;)&#039;) AS title FROM #__content&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
You can also specify a static option in the XML using &amp;lt;option&amp;gt;&amp;lt;/option&amp;gt; tag. Please look at the following example.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;field&lt;br /&gt;
    name=&amp;quot;myfield&amp;quot;&lt;br /&gt;
    type=&amp;quot;sql&amp;quot;&lt;br /&gt;
    default=&amp;quot;10&amp;quot;&lt;br /&gt;
    label=&amp;quot;Select an article&amp;quot;&lt;br /&gt;
    query=&amp;quot;SELECT id, title FROM #__content&amp;quot;&lt;br /&gt;
    key_field=&amp;quot;id&amp;quot;&lt;br /&gt;
    value_field=&amp;quot;title&amp;quot;&lt;br /&gt;
    required=&amp;quot;true&amp;quot;&lt;br /&gt;
    &amp;gt;&lt;br /&gt;
    &amp;lt;option value=&amp;quot;&amp;quot;&amp;gt;Please select your option&amp;lt;/option&amp;gt;&lt;br /&gt;
&amp;lt;/field&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Alternatively, you can achieve the same result using the &#039;&#039;&#039;header&#039;&#039;&#039; attribute as follows:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;field&lt;br /&gt;
    name=&amp;quot;myfield&amp;quot;&lt;br /&gt;
    type=&amp;quot;sql&amp;quot;&lt;br /&gt;
    default=&amp;quot;10&amp;quot;&lt;br /&gt;
    label=&amp;quot;Select an article&amp;quot;&lt;br /&gt;
    query=&amp;quot;SELECT id, title FROM #__content&amp;quot;&lt;br /&gt;
    key_field=&amp;quot;id&amp;quot;&lt;br /&gt;
    value_field=&amp;quot;title&amp;quot;&lt;br /&gt;
    required=&amp;quot;true&amp;quot;&lt;br /&gt;
    header=&amp;quot;Please select your option&amp;quot;&lt;br /&gt;
    /&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
==== Alternative query syntax ====&lt;br /&gt;
Starting with Joomla 3.5, an alternative to the &#039;&#039;&#039;query&#039;&#039;&#039; attribute allows some additional features.  These features are not available if the &#039;&#039;&#039;query&#039;&#039;&#039; attribute is present.  For example, this field definition:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;field&lt;br /&gt;
    name=&amp;quot;example_group&amp;quot;&lt;br /&gt;
    type=&amp;quot;sql&amp;quot;&lt;br /&gt;
    label=&amp;quot;COM_EXAMPLE_GROUP&amp;quot;&lt;br /&gt;
    query=&amp;quot;SELECT e.* FROM #__example AS e GROUP BY name ORDER e.id ASC&amp;quot;&lt;br /&gt;
    key_field=&amp;quot;id&amp;quot;&lt;br /&gt;
    value_field=&amp;quot;name&amp;quot;&lt;br /&gt;
    /&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
can be expressed as:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;field&lt;br /&gt;
    name=&amp;quot;example_group&amp;quot; &lt;br /&gt;
    type=&amp;quot;sql&amp;quot; &lt;br /&gt;
    label=&amp;quot;COM_EXAMPLE_GROUP&amp;quot; &lt;br /&gt;
    sql_select=&amp;quot;e.*&amp;quot; &lt;br /&gt;
    sql_from=&amp;quot;#__example AS e&amp;quot; &lt;br /&gt;
    sql_group=&amp;quot;name&amp;quot; &lt;br /&gt;
    sql_order=&amp;quot;e.id ASC&amp;quot; &lt;br /&gt;
    key_field=&amp;quot;id&amp;quot;&lt;br /&gt;
    value_field=&amp;quot;name&amp;quot; &lt;br /&gt;
    /&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
{{warning|&amp;lt;translate&amp;gt;&amp;lt;!--T:25--&amp;gt; The following feature &#039;&#039;linked fields as filters&#039;&#039; is currently not working! See [https://github.com/joomla/joomla-cms/issues/22241 Github issue 22241]&amp;lt;/translate&amp;gt;}}&lt;br /&gt;
One advantage to using this syntax is that it allows the use of linked fields as filters.  For example, suppose you have a form containing two select lists, one called &#039;&#039;groups&#039;&#039; and the other called &#039;&#039;subgroups&#039;&#039;.  The &#039;&#039;groups&#039;&#039; field is straightforward:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;field name=&amp;quot;groups&amp;quot;&lt;br /&gt;
    type=&amp;quot;sql&amp;quot;&lt;br /&gt;
    label=&amp;quot;COM_EXAMPLE_GROUPS&amp;quot;&lt;br /&gt;
    sql_select=&amp;quot;e.*&amp;quot;&lt;br /&gt;
    sql_from=&amp;quot;#__example_groups AS e&amp;quot;&lt;br /&gt;
    sql_group=&amp;quot;name&amp;quot;&lt;br /&gt;
    sql_order=&amp;quot;e.id ASC&amp;quot;&lt;br /&gt;
    key_field=&amp;quot;id&amp;quot;&lt;br /&gt;
    value_field=&amp;quot;name&amp;quot;&lt;br /&gt;
    /&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
but the &#039;&#039;subgroups&#039;&#039; field includes an &#039;&#039;&#039;sql_filter&#039;&#039;&#039; attribute which refers to the &#039;&#039;groups&#039;&#039; field by name:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;field name=&amp;quot;subgroups&amp;quot;&lt;br /&gt;
    type=&amp;quot;sql&amp;quot;&lt;br /&gt;
    label=&amp;quot;COM_EXAMPLE_SUBGROUPS&amp;quot;&lt;br /&gt;
    sql_select=&amp;quot;e.*&amp;quot;&lt;br /&gt;
    sql_from=&amp;quot;#__example_subgroups AS e&amp;quot;&lt;br /&gt;
    sql_group=&amp;quot;name&amp;quot;&lt;br /&gt;
    sql_order=&amp;quot;e.id ASC&amp;quot;&lt;br /&gt;
    sql_filter=&amp;quot;groups&amp;quot;&lt;br /&gt;
    key_field=&amp;quot;id&amp;quot;&lt;br /&gt;
    value_field=&amp;quot;name&amp;quot;&lt;br /&gt;
    /&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Then if the &#039;&#039;groups&#039;&#039; field has the value &#039;&#039;99&#039;&#039;, the following SQL statement will be executed for the &#039;&#039;subgroups&#039;&#039; field:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
SELECT e.* FROM jos_example_subgroups AS e WHERE `groups` = 99 GROUP BY `name` ORDER BY e.id ASC&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
To filter on multiple fields, you can use a comma-separated list of filter names in the &#039;&#039;&#039;sql_filter&#039;&#039;&#039; clause.  For example, if there is a filter called &#039;&#039;groups&#039;&#039; with the value &#039;&#039;99&#039;&#039; and a filter called &#039;&#039;categories&#039;&#039; with the value &#039;&#039;12&#039;&#039;, then&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
sql_filter=&amp;quot;groups,categories&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
will produce the SQL WHERE clause:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
WHERE `groups` = 99 AND `categories` = 12&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
You can also define a default value for any filter that might not have a value when the field is evaluated by adding &#039;&#039;&#039;sql_default_{FIELD_NAME}&#039;&#039;&#039; attributes.  For example, suppose that the default value for the &#039;&#039;groups&#039;&#039; filter is 0 and the default value for the &#039;&#039;categories&#039;&#039; filter is 0, then this definition:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;field name=&amp;quot;subgroups&amp;quot;&lt;br /&gt;
    type=&amp;quot;sql&amp;quot;&lt;br /&gt;
    label=&amp;quot;COM_EXAMPLE_SUBGROUPS&amp;quot;&lt;br /&gt;
    sql_select=&amp;quot;e.*&amp;quot;&lt;br /&gt;
    sql_from=&amp;quot;#__example_subgroups AS e&amp;quot;&lt;br /&gt;
    sql_group=&amp;quot;name&amp;quot;&lt;br /&gt;
    sql_order=&amp;quot;e.id ASC&amp;quot;&lt;br /&gt;
    sql_filter=&amp;quot;groups,categories&amp;quot;&lt;br /&gt;
    sql_default_groups=&amp;quot;0&amp;quot;&lt;br /&gt;
    sql_default_categories=&amp;quot;1&amp;quot;&lt;br /&gt;
    key_field=&amp;quot;id&amp;quot;&lt;br /&gt;
    value_field=&amp;quot;name&amp;quot;&lt;br /&gt;
    /&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
will produce this SQL statement when initially evaluated with no filters:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
SELECT e.* FROM jos_example_subgroups AS e WHERE `groups` = 0 AND `categories` = 1 GROUP BY `name` ORDER BY e.id ASC&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
Note: The SQL statements will need to be correct for the type and version of the underlying database that Joomla is running on. This will most likely be a version of MySQL, but it could be something else.  There is no capability to query databases other than the one Joomla itself is running on.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
Note: As shown in these examples, the database prefix (often &amp;lt;code&amp;gt;jos&amp;lt;/code&amp;gt;) should be entered in the form &amp;lt;code&amp;gt;#__&amp;lt;/code&amp;gt; (hash-underscore-underscore). It will automatically be replaced by the actual database prefix used by Joomla.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== See also === &amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
* [[S:MyLanguage/Standard form field types|List of standard form field types]]&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&amp;lt;translate&amp;gt;&amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
[[Category:Standard form field types]]&amp;lt;/translate&amp;gt;&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Adrian</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Plugin/Events/Extension&amp;diff=440611</id>
		<title>Plugin/Events/Extension</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Plugin/Events/Extension&amp;diff=440611"/>
		<updated>2017-07-28T12:45:22Z</updated>

		<summary type="html">&lt;p&gt;Adrian: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{page|needs completion|This page need completing to be a useful doc reference.}}&lt;br /&gt;
&lt;br /&gt;
== onExtensionAfterInstall ==&lt;br /&gt;
&lt;br /&gt;
=== Description ===&lt;br /&gt;
&lt;br /&gt;
=== Parameters ===&lt;br /&gt;
&lt;br /&gt;
$installerObject&lt;br /&gt;
$extensionID&lt;br /&gt;
&lt;br /&gt;
=== Return Value ===&lt;br /&gt;
&lt;br /&gt;
=== Called in files ===&lt;br /&gt;
&lt;br /&gt;
== onExtensionAfterUninstall ==&lt;br /&gt;
&lt;br /&gt;
=== Description ===&lt;br /&gt;
&lt;br /&gt;
=== Parameters ===&lt;br /&gt;
&lt;br /&gt;
=== Return Value ===&lt;br /&gt;
&lt;br /&gt;
=== Called in files ===&lt;br /&gt;
&lt;br /&gt;
== onExtensionAfterUpdate ==&lt;br /&gt;
&lt;br /&gt;
=== Description ===&lt;br /&gt;
&lt;br /&gt;
=== Parameters ===&lt;br /&gt;
&lt;br /&gt;
=== Return Value ===&lt;br /&gt;
&lt;br /&gt;
=== Called in files ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Plugin Development]][[Category:Specifications]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Adrian</name></author>
	</entry>
</feed>