SQL Field Guide

The SQL form field provides a drop down list of entries obtained by running a query on the Joomla database.

Field Settings

Select: It is the SELECT clause of the SQL statement. This is required. Enter the comma separated names of the columns to select. For example: id,title

From: It is the FROM clause of the SQL statement. This is required. This is the name of the database table. You need to add prefix #__ (hash symbol with two underscores) before the table name. For example, "#__content".

Where: It is the WHERE clause of the SQL statement. You can add conditions to filter the records.

Group By: It is the GROUP BY clause of the SQL statement.

Order By: It is the ORDER BY clause of the SQL statement. For example, to order the records in ascending order by title, enter "title ASC".

Key Field: It is the name of the column that will contain values for the parameter. This is saved in the database. For example, id.

Value Field: It is the name of the column that will contain values to be shown to the user in the drop-down list. For example, title.

Header: It will add an entry, with an empty value, at the top of the list of drop down options. Use this setting to add a "- Select something -" entry to the list.

Multiple: Whether multiple values can be selected from the dropdown list.

Form Layout: Choose the layout that will be used to render the field.