Single Items

Single items return a single value from a SQL query with no added formatting, so that when they are used in an article they appear to be part of your article text. For example: “Our download count today stands at 436,991", or "today is Monday the 15th of March". A single value just returns the first column of the first row returned by the query, with no formatting or html at all. Here’s another example:

SELECT CASE WHEN HOUR(NOW()) >= 18 THEN "Good evening"
    WHEN HOUR(NOW()) >= 12 THEN "Good afternoon"
    ELSE "Good morning" END

There are no rules about the number of columns or their type.

If you set the Plotalot component configuration option to allow non-select queries, you can use a single item to insert or update a database row every time a page is visited. For example:

UPDATE `#__hit_counts` WHERE `page` = '51' SET `counter` = `counter` + 1