<?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=Honje</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=Honje"/>
	<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/Special:Contributions/Honje"/>
	<updated>2026-08-17T04:01:27Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Using_the_database&amp;diff=445059</id>
		<title>J3.x:Developing an MVC Component/Using the database</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Using_the_database&amp;diff=445059"/>
		<updated>2017-09-12T10:27:54Z</updated>

		<summary type="html">&lt;p&gt;Honje: &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;
{{:J3.1:Developing an MVC Component/&amp;lt;translate&amp;gt;&amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
en&amp;lt;/translate&amp;gt;}}&lt;br /&gt;
&amp;lt;translate&amp;gt;== Introduction == &amp;lt;!--T:2--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
This tutorial is part of the [[S:MyLanguage/J3.3:Developing an MVC Component | Developing an MVC Component for Joomla! 3.3]] tutorial. You are encouraged to read the previous parts of the tutorial before reading this. Also while doing this part you are also encouraged to read more on database queries, selecting data from a database table and retrieving it in several formats [[S:MyLanguage/Selecting_data_using_JDatabase|here]].&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:32--&amp;gt; There are also 3 videos associated with this step in the tutorial, covering [https://www.youtube.com/watch?v=JWS_3rx8RzY the Database Setup], [https://www.youtube.com/watch?v=rKEHDeFGlGM Displaying the message (using JTable)] and [https://www.youtube.com/watch?v=uEDNyG6pSEk Admin message selection (and JDatabase)].&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{#widget:YouTube|id=JWS_3rx8RzY}}&lt;br /&gt;
&lt;br /&gt;
{{#widget:YouTube|id=rKEHDeFGlGM}}&lt;br /&gt;
&lt;br /&gt;
{{#widget:YouTube|id=uEDNyG6pSEk}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;== Using the database == &amp;lt;!--T:4--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
Components usually manage their contents using the database. During the install/uninstall/update phase of a component, you can execute SQL queries through the use of SQL text files.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
With your favourite file manager and editor create two files called &amp;lt;tt&amp;gt;admin/sql/install.mysql.utf8.sql&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;admin/sql/updates/mysql/0.0.6.sql&amp;lt;/tt&amp;gt;. They should both have the same content, as follows:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/sql/install.mysql.utf8.sql&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;admin/sql/install.mysql.utf8.sql&#039;&#039;&#039; and &#039;&#039;&#039;admin/sql/updates/mysql/0.0.6.sql&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
DROP TABLE IF EXISTS `#__helloworld`;&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE `#__helloworld` (&lt;br /&gt;
	`id`       INT(11)     NOT NULL AUTO_INCREMENT,&lt;br /&gt;
	`greeting` VARCHAR(25) NOT NULL,&lt;br /&gt;
	`published` tinyint(4) NOT NULL DEFAULT &#039;1&#039;,&lt;br /&gt;
	PRIMARY KEY (`id`)&lt;br /&gt;
)&lt;br /&gt;
	ENGINE =MyISAM&lt;br /&gt;
	AUTO_INCREMENT =0&lt;br /&gt;
	DEFAULT CHARSET =utf8;&lt;br /&gt;
&lt;br /&gt;
INSERT INTO `#__helloworld` (`greeting`) VALUES&lt;br /&gt;
(&#039;Hello World!&#039;),&lt;br /&gt;
(&#039;Good bye World!&#039;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
The file &amp;lt;tt&amp;gt;install.mysql.utf8.sql&amp;lt;/tt&amp;gt; will be executed when you install this component. The file &#039;&#039;0.0.6.sql&#039;&#039; is executed when you do an update.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Important Note:&#039;&#039;&#039; When the component is installed, the files in the SQL updates folder (for example, &#039;&#039;admin/sql/updates/mysql&#039;&#039;) are read and the name of the last file alphabetically is used to populate the component&#039;s version number in the &amp;lt;code&amp;gt;#__schemas&amp;lt;/code&amp;gt; table. This value must be in this table in order for the automatic update to execute the update SQL files for future versions. For this reason, it is good practice to create a SQL update file for each version (even if it is empty or just has a comment). This way the &amp;lt;code&amp;gt;#__schemas&amp;lt;/code&amp;gt; version will always match the component version.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Important Note:&#039;&#039;&#039; When saving the SQL files in utf8, be sure to save them as utf8 NOT BOM or the query will fail with MySQL error #1064.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
This is the install file. It will be executed if you put an appropriate order in the &amp;lt;tt&amp;gt;helloworld.xml&amp;lt;/tt&amp;gt; file.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;helloworld.xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;helloworld.xml&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot; highlight=&amp;quot;13,17-26,58-61&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;extension type=&amp;quot;component&amp;quot; version=&amp;quot;3.2.0&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;name&amp;gt;Hello World!&amp;lt;/name&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The following elements are optional and free of formatting constraints --&amp;gt;&lt;br /&gt;
	&amp;lt;creationDate&amp;gt;January 2014&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
	&amp;lt;author&amp;gt;John Doe&amp;lt;/author&amp;gt;&lt;br /&gt;
	&amp;lt;authorEmail&amp;gt;john.doe@example.org&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
	&amp;lt;authorUrl&amp;gt;http://www.example.org&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
	&amp;lt;copyright&amp;gt;Copyright Info&amp;lt;/copyright&amp;gt;&lt;br /&gt;
	&amp;lt;license&amp;gt;License Info&amp;lt;/license&amp;gt;&lt;br /&gt;
	&amp;lt;!--  The version string is recorded in the components table --&amp;gt;&lt;br /&gt;
	&amp;lt;version&amp;gt;0.0.6&amp;lt;/version&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The description is optional and defaults to the name --&amp;gt;&lt;br /&gt;
	&amp;lt;description&amp;gt;Description of the Hello World component ...&amp;lt;/description&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;install&amp;gt; &amp;lt;!-- Runs on install --&amp;gt;&lt;br /&gt;
		&amp;lt;sql&amp;gt;&lt;br /&gt;
			&amp;lt;file driver=&amp;quot;mysql&amp;quot; charset=&amp;quot;utf8&amp;quot;&amp;gt;sql/install.mysql.utf8.sql&amp;lt;/file&amp;gt;&lt;br /&gt;
		&amp;lt;/sql&amp;gt;&lt;br /&gt;
	&amp;lt;/install&amp;gt;&lt;br /&gt;
	&amp;lt;uninstall&amp;gt; &amp;lt;!-- Runs on uninstall --&amp;gt;&lt;br /&gt;
		&amp;lt;sql&amp;gt;&lt;br /&gt;
			&amp;lt;file driver=&amp;quot;mysql&amp;quot; charset=&amp;quot;utf8&amp;quot;&amp;gt;sql/uninstall.mysql.utf8.sql&amp;lt;/file&amp;gt;&lt;br /&gt;
		&amp;lt;/sql&amp;gt;&lt;br /&gt;
	&amp;lt;/uninstall&amp;gt;&lt;br /&gt;
	&amp;lt;update&amp;gt; &amp;lt;!-- Runs on update; New since J2.5 --&amp;gt;&lt;br /&gt;
		&amp;lt;schemas&amp;gt;&lt;br /&gt;
			&amp;lt;schemapath type=&amp;quot;mysql&amp;quot;&amp;gt;sql/updates/mysql&amp;lt;/schemapath&amp;gt;&lt;br /&gt;
		&amp;lt;/schemas&amp;gt;&lt;br /&gt;
	&amp;lt;/update&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;!-- Site Main File Copy Section --&amp;gt;&lt;br /&gt;
	&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
		to copy FROM in the package to install therefore files copied&lt;br /&gt;
		in this section are copied from /site/ in the package --&amp;gt;&lt;br /&gt;
	&amp;lt;files folder=&amp;quot;site&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;controller.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;views&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;models&amp;lt;/folder&amp;gt;&lt;br /&gt;
	&amp;lt;/files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;administration&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Menu Section --&amp;gt;&lt;br /&gt;
		&amp;lt;menu link=&#039;index.php?option=com_helloworld&#039;&amp;gt;Hello World!&amp;lt;/menu&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Main File Copy Section --&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
			to copy FROM in the package to install therefore files copied&lt;br /&gt;
			in this section are copied from /admin/ in the package --&amp;gt;&lt;br /&gt;
		&amp;lt;files folder=&amp;quot;admin&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;!-- Admin Main File Copy Section --&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;!-- SQL files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;sql&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- tables files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;tables&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- models files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;models&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;/files&amp;gt;&lt;br /&gt;
	&amp;lt;/administration&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
Do the same for the uninstall file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
With your favourite file manager and editor put a file &amp;lt;tt&amp;gt;admin/sql/uninstall.mysql.utf8.sql&amp;lt;/tt&amp;gt; containing:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/sql/uninstall.mysql.utf8.sql&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;admin/sql/uninstall.mysql.utf8.sql&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
DROP TABLE IF EXISTS `#__helloworld`;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;== Adding a new field type == &amp;lt;!--T:13--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
For the moment, we have used a [[S:MyLanguage/J3.3:Developing an MVC Component/Adding a menu type to the site part|hard coded field type for messages]]. We need to use our database for choosing the message, and for this we need to define a custom field type (which we call &#039;&#039;helloworld&#039;&#039; below) as described [https://docs.joomla.org/Creating_a_custom_form_field_type here].&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
Modify the &amp;lt;tt&amp;gt;site/views/helloworld/tmpl/default.xml&amp;lt;/tt&amp;gt; file and put these lines&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/views/helloworld/tmpl/default.xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;site/views/helloworld/tmpl/default.xml&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot; highlight=&amp;quot;8,11-16&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;metadata&amp;gt;&lt;br /&gt;
	&amp;lt;layout title=&amp;quot;COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_TITLE&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;message&amp;gt;COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_DESC&amp;lt;/message&amp;gt;&lt;br /&gt;
	&amp;lt;/layout&amp;gt;&lt;br /&gt;
	&amp;lt;fields&lt;br /&gt;
			name=&amp;quot;request&amp;quot;&lt;br /&gt;
			addfieldpath=&amp;quot;/administrator/components/com_helloworld/models/fields&amp;quot;&lt;br /&gt;
			&amp;gt;&lt;br /&gt;
		&amp;lt;fieldset name=&amp;quot;request&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;field&lt;br /&gt;
					name=&amp;quot;id&amp;quot;&lt;br /&gt;
					type=&amp;quot;helloworld&amp;quot;&lt;br /&gt;
					label=&amp;quot;COM_HELLOWORLD_HELLOWORLD_FIELD_GREETING_LABEL&amp;quot;&lt;br /&gt;
					description=&amp;quot;COM_HELLOWORLD_HELLOWORLD_FIELD_GREETING_DESC&amp;quot;&lt;br /&gt;
					/&amp;gt;&lt;br /&gt;
		&amp;lt;/fieldset&amp;gt;&lt;br /&gt;
	&amp;lt;/fields&amp;gt;&lt;br /&gt;
&amp;lt;/metadata&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
It introduces a new field type and tells Joomla to look for the field definition in the &amp;lt;tt&amp;gt;/administrator/components/com_helloworld/models/fields&amp;lt;/tt&amp;gt; folder.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
In order to learn more on database queries, selecting data from a database table and retrieving it in several formats [[S:MyLanguage/Selecting_data_using_JDatabase|click here]].&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
With your favourite file manager and editor put a file &#039;&#039;admin/models/fields/helloworld.php&#039;&#039; containing:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/models/fields/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;admin/models/fields/helloworld.php&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
JFormHelper::loadFieldClass(&#039;list&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * HelloWorld Form Field class for the HelloWorld component&lt;br /&gt;
 *&lt;br /&gt;
 * @since  0.0.1&lt;br /&gt;
 */&lt;br /&gt;
class JFormFieldHelloWorld extends JFormFieldList&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * The field type.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @var         string&lt;br /&gt;
	 */&lt;br /&gt;
	protected $type = &#039;HelloWorld&#039;;&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Method to get a list of options for a list input.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return  array  An array of JHtml options.&lt;br /&gt;
	 */&lt;br /&gt;
	protected function getOptions()&lt;br /&gt;
	{&lt;br /&gt;
		$db    = JFactory::getDBO();&lt;br /&gt;
		$query = $db-&amp;gt;getQuery(true);&lt;br /&gt;
		$query-&amp;gt;select(&#039;id,greeting&#039;);&lt;br /&gt;
		$query-&amp;gt;from(&#039;#__helloworld&#039;);&lt;br /&gt;
		$db-&amp;gt;setQuery((string) $query);&lt;br /&gt;
		$messages = $db-&amp;gt;loadObjectList();&lt;br /&gt;
		$options  = array();&lt;br /&gt;
&lt;br /&gt;
		if ($messages)&lt;br /&gt;
		{&lt;br /&gt;
			foreach ($messages as $message)&lt;br /&gt;
			{&lt;br /&gt;
				$options[] = JHtml::_(&#039;select.option&#039;, $message-&amp;gt;id, $message-&amp;gt;greeting);&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		$options = array_merge(parent::getOptions(), $options);&lt;br /&gt;
&lt;br /&gt;
		return $options;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
The new field type displays a drop-down list of messages to choose from. You can see the result of this change in the menu manager section for the helloworld item.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;== Display the chosen message == &amp;lt;!--T:20--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
When a menu item of this component is created/updated, Joomla stores the identifier of the message. The &amp;lt;tt&amp;gt;HelloWorldModelHelloWorld&amp;lt;/tt&amp;gt; model has now to compute the message according to this identifier and the data stored in the database. To do this is uses the [https://docs.joomla.org/Using_the_JTable_class JTable] functionality, which is an alternative to JDatabase if only CRUD operations on single records are required.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
Modify the &amp;lt;tt&amp;gt;site/models/helloworld.php&amp;lt;/tt&amp;gt; file:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/models/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;site/models/helloworld.php&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * HelloWorld Model&lt;br /&gt;
 *&lt;br /&gt;
 * @since  0.0.1&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldModelHelloWorld extends JModelItem&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * @var array messages&lt;br /&gt;
	 */&lt;br /&gt;
	protected $messages;&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Method to get a table object, load it if necessary.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @param   string  $type    The table name. Optional.&lt;br /&gt;
	 * @param   string  $prefix  The class prefix. Optional.&lt;br /&gt;
	 * @param   array   $config  Configuration array for model. Optional.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return  JTable  A JTable object&lt;br /&gt;
	 *&lt;br /&gt;
	 * @since   1.6&lt;br /&gt;
	 */&lt;br /&gt;
	public function getTable($type = &#039;HelloWorld&#039;, $prefix = &#039;HelloWorldTable&#039;, $config = array())&lt;br /&gt;
	{&lt;br /&gt;
		return JTable::getInstance($type, $prefix, $config);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Get the message&lt;br /&gt;
	 *&lt;br /&gt;
	 * @param   integer  $id  Greeting Id&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return  string        Fetched String from Table for relevant Id&lt;br /&gt;
	 */&lt;br /&gt;
	public function getMsg($id = 1)&lt;br /&gt;
	{&lt;br /&gt;
		if (!is_array($this-&amp;gt;messages))&lt;br /&gt;
		{&lt;br /&gt;
			$this-&amp;gt;messages = array();&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		if (!isset($this-&amp;gt;messages[$id]))&lt;br /&gt;
		{&lt;br /&gt;
			// Request the selected id&lt;br /&gt;
			$jinput = JFactory::getApplication()-&amp;gt;input;&lt;br /&gt;
			$id     = $jinput-&amp;gt;get(&#039;id&#039;, 1, &#039;INT&#039;);&lt;br /&gt;
&lt;br /&gt;
			// Get a TableHelloWorld instance&lt;br /&gt;
			$table = $this-&amp;gt;getTable();&lt;br /&gt;
&lt;br /&gt;
			// Load the message&lt;br /&gt;
			$table-&amp;gt;load($id);&lt;br /&gt;
&lt;br /&gt;
			// Assign the message&lt;br /&gt;
			$this-&amp;gt;messages[$id] = $table-&amp;gt;greeting;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		return $this-&amp;gt;messages[$id];&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
The model now asks the &#039;&#039;TableHelloWorld&#039;&#039; to get the message. This table class has to be defined in &amp;lt;tt&amp;gt;admin/tables/helloworld.php&amp;lt;/tt&amp;gt; file&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/tables/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;admin/tables/helloworld.php&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
// No direct access&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Hello Table class&lt;br /&gt;
 *&lt;br /&gt;
 * @since  0.0.1&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldTableHelloWorld extends JTable&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * Constructor&lt;br /&gt;
	 *&lt;br /&gt;
	 * @param   JDatabaseDriver  &amp;amp;$db  A database connector object&lt;br /&gt;
	 */&lt;br /&gt;
	function __construct(&amp;amp;$db)&lt;br /&gt;
	{&lt;br /&gt;
		parent::__construct(&#039;#__helloworld&#039;, &#039;id&#039;, $db);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
You shouldn&#039;t see any differences, but if you access the database you should see a table named &#039;&#039;jos_helloworld&#039;&#039; with two columns: id and greeting. And two entries: &#039;&#039;Hello World!&#039;&#039; and &#039;&#039;Good bye World&#039;&#039;.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;== Packaging the component == &amp;lt;!--T:25--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
Content of your code directory&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;[[#helloworld.xml|helloworld.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Adding_a_view_to_the_site_part#site/helloworld.php|site/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|site/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Adding_a_view_to_the_site_part#site/controller.php|site/controller.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|site/views/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|site/views/helloworld/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Adding_a_view_to_the_site_part#site/views/helloworld/view.html.php|site/views/helloworld/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|site/views/helloworld/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#site/views/helloworld/tmpl/default.xml|site/views/helloworld/tmpl/default.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Adding_a_view_to_the_site_part#site/views/helloworld/tmpl/default.php|site/views/helloworld/tmpl/default.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|site/models/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#site/models/helloworld.php|site/models/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|admin/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#admin/helloworld.php|admin/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/sql/install.mysql.utf8.sql|admin/sql/install.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/sql/uninstall.mysql.utf8.sql|admin/sql/uninstall.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/updates/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/updates/mysql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#admin/sql/updates/mysql/0.0.1.sql|admin/sql/updates/mysql/0.0.1.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/sql/install.mysql.utf8.sql|admin/sql/updates/mysql/0.0.6.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|admin/models/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/models/helloworld.php|admin/models/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|admin/models/fields/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/models/fields/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|admin/tables/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/tables/helloworld.php|admin/tables/helloworld.php]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
Create a compressed file of this directory or directly download the [https://github.com/scionescire/Joomla-3.2-Hello-World-Component/archive/step-6-using-the-database.zip archive] and install it using the extension manager of Joomla. You can add a menu item of this component using the menu manager in the backend.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{notice|&amp;lt;translate&amp;gt;&amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
Please create a pull request or issue at https://github.com/joomla/Joomla-3.2-Hello-World-Component for any code discrepancies or if editing any of the source code on this page.&amp;lt;/translate&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
*[[User:cdemko|Christophe Demko]]&lt;br /&gt;
*[[User:oaksu|Ozgur Aksu]]&lt;br /&gt;
*[[User:scionescire|Scionescire]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;row&amp;quot;&amp;gt; &lt;br /&gt;
&amp;lt;div class=&amp;quot;large-6 columns&amp;quot;&amp;gt;{{Basic button|&amp;lt;translate&amp;gt;&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
S:MyLanguage/J3.x:Developing_an_MVC_Component/Adding a variable request in the menu type|Prev: Adding a variable request in the menu type&amp;lt;/translate&amp;gt;|class=expand success}}&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;large-6 columns&amp;quot;&amp;gt;{{Basic button|&amp;lt;translate&amp;gt;&amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
S:MyLanguage/J3.x:Developing_an_MVC_Component/Basic backend|Next: Basic backend&amp;lt;/translate&amp;gt;|class=expand}}&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
[[Category:Joomla! 3.x]]&lt;br /&gt;
[[Category:Joomla! 3.0]]&lt;br /&gt;
[[Category:Joomla! 3.1]]&lt;br /&gt;
[[Category:Joomla! 3.2]]&lt;br /&gt;
[[Category:Joomla! 3.3]]&lt;br /&gt;
[[Category:Joomla! 3.4]]&lt;br /&gt;
[[Category:Beginner Development]]&lt;br /&gt;
[[Category:Component Development]]&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
[[Category:Tutorials in a Series]]&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Honje</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Using_the_database&amp;diff=445058</id>
		<title>J3.x:Developing an MVC Component/Using the database</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Using_the_database&amp;diff=445058"/>
		<updated>2017-09-12T10:22:58Z</updated>

		<summary type="html">&lt;p&gt;Honje: &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;
{{:J3.1:Developing an MVC Component/&amp;lt;translate&amp;gt;&amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
en&amp;lt;/translate&amp;gt;}}&lt;br /&gt;
&amp;lt;translate&amp;gt;== Introduction == &amp;lt;!--T:2--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
This tutorial is part of the [[S:MyLanguage/J3.3:Developing an MVC Component | Developing an MVC Component for Joomla! 3.3]] tutorial. You are encouraged to read the previous parts of the tutorial before reading this. Also while doing this part you are also encouraged to read more on database queries, selecting data from a database table and retrieving it in several formats [[S:MyLanguage/Selecting_data_using_JDatabase|here]].&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:32--&amp;gt; There are also 3 videos associated with this step in the tutorial, covering [https://www.youtube.com/watch?v=JWS_3rx8RzY the Database Setup], [https://www.youtube.com/watch?v=rKEHDeFGlGM Displaying the message (using JTable)] and [https://www.youtube.com/watch?v=uEDNyG6pSEk Admin message selection (and JDatabase)].&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{#widget:YouTube|id=JWS_3rx8RzY}}&lt;br /&gt;
&lt;br /&gt;
{{#widget:YouTube|id=rKEHDeFGlGM}}&lt;br /&gt;
&lt;br /&gt;
{{#widget:YouTube|id=uEDNyG6pSEk}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;== Using the database == &amp;lt;!--T:4--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
Components usually manage their contents using the database. During the install/uninstall/update phase of a component, you can execute SQL queries through the use of SQL text files.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
With your favourite file manager and editor create two files called &amp;lt;tt&amp;gt;admin/sql/install.mysql.utf8.sql&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;admin/sql/updates/mysql/0.0.6.sql&amp;lt;/tt&amp;gt;. They should both have the same content, as follows:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/sql/install.mysql.utf8.sql&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;admin/sql/install.mysql.utf8.sql&#039;&#039;&#039; and &#039;&#039;&#039;admin/sql/updates/mysql/0.0.6.sql&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
DROP TABLE IF EXISTS `#__helloworld`;&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE `#__helloworld` (&lt;br /&gt;
	`id`       INT(11)     NOT NULL AUTO_INCREMENT,&lt;br /&gt;
	`greeting` VARCHAR(25) NOT NULL,&lt;br /&gt;
	`published` tinyint(4) NOT NULL DEFAULT &#039;1&#039;,&lt;br /&gt;
	PRIMARY KEY (`id`)&lt;br /&gt;
)&lt;br /&gt;
	ENGINE =MyISAM&lt;br /&gt;
	AUTO_INCREMENT =0&lt;br /&gt;
	DEFAULT CHARSET =utf8;&lt;br /&gt;
&lt;br /&gt;
INSERT INTO `#__helloworld` (`greeting`) VALUES&lt;br /&gt;
(&#039;Hello World!&#039;),&lt;br /&gt;
(&#039;Good bye World!&#039;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
The file &amp;lt;tt&amp;gt;install.mysql.utf8.sql&amp;lt;/tt&amp;gt; will be executed when you install this component. The file &#039;&#039;0.0.6.sql&#039;&#039; is executed when you do an update.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Important Note:&#039;&#039;&#039; When the component is installed, the files in the SQL updates folder (for example, &#039;&#039;admin/sql/updates/mysql&#039;&#039;) are read and the name of the last file alphabetically is used to populate the component&#039;s version number in the &amp;lt;code&amp;gt;#__schemas&amp;lt;/code&amp;gt; table. This value must be in this table in order for the automatic update to execute the update SQL files for future versions. For this reason, it is good practice to create a SQL update file for each version (even if it is empty or just has a comment). This way the &amp;lt;code&amp;gt;#__schemas&amp;lt;/code&amp;gt; version will always match the component version.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Important Note:&#039;&#039;&#039; When saving the SQL files in utf8, be sure to save them as utf8 NOT BOM or the query will fail with MySQL error #1064.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
This is the install file. It will be executed if you put an appropriate order in the &amp;lt;tt&amp;gt;helloworld.xml&amp;lt;/tt&amp;gt; file.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;helloworld.xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;helloworld.xml&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot; highlight=&amp;quot;13,17-26,58-61&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;extension type=&amp;quot;component&amp;quot; version=&amp;quot;3.2.0&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;name&amp;gt;Hello World!&amp;lt;/name&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The following elements are optional and free of formatting constraints --&amp;gt;&lt;br /&gt;
	&amp;lt;creationDate&amp;gt;January 2014&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
	&amp;lt;author&amp;gt;John Doe&amp;lt;/author&amp;gt;&lt;br /&gt;
	&amp;lt;authorEmail&amp;gt;john.doe@example.org&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
	&amp;lt;authorUrl&amp;gt;http://www.example.org&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
	&amp;lt;copyright&amp;gt;Copyright Info&amp;lt;/copyright&amp;gt;&lt;br /&gt;
	&amp;lt;license&amp;gt;License Info&amp;lt;/license&amp;gt;&lt;br /&gt;
	&amp;lt;!--  The version string is recorded in the components table --&amp;gt;&lt;br /&gt;
	&amp;lt;version&amp;gt;0.0.6&amp;lt;/version&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The description is optional and defaults to the name --&amp;gt;&lt;br /&gt;
	&amp;lt;description&amp;gt;Description of the Hello World component ...&amp;lt;/description&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;install&amp;gt; &amp;lt;!-- Runs on install --&amp;gt;&lt;br /&gt;
		&amp;lt;sql&amp;gt;&lt;br /&gt;
			&amp;lt;file driver=&amp;quot;mysql&amp;quot; charset=&amp;quot;utf8&amp;quot;&amp;gt;sql/install.mysql.utf8.sql&amp;lt;/file&amp;gt;&lt;br /&gt;
		&amp;lt;/sql&amp;gt;&lt;br /&gt;
	&amp;lt;/install&amp;gt;&lt;br /&gt;
	&amp;lt;uninstall&amp;gt; &amp;lt;!-- Runs on uninstall --&amp;gt;&lt;br /&gt;
		&amp;lt;sql&amp;gt;&lt;br /&gt;
			&amp;lt;file driver=&amp;quot;mysql&amp;quot; charset=&amp;quot;utf8&amp;quot;&amp;gt;sql/uninstall.mysql.utf8.sql&amp;lt;/file&amp;gt;&lt;br /&gt;
		&amp;lt;/sql&amp;gt;&lt;br /&gt;
	&amp;lt;/uninstall&amp;gt;&lt;br /&gt;
	&amp;lt;update&amp;gt; &amp;lt;!-- Runs on update; New since J2.5 --&amp;gt;&lt;br /&gt;
		&amp;lt;schemas&amp;gt;&lt;br /&gt;
			&amp;lt;schemapath type=&amp;quot;mysql&amp;quot;&amp;gt;sql/updates/mysql&amp;lt;/schemapath&amp;gt;&lt;br /&gt;
		&amp;lt;/schemas&amp;gt;&lt;br /&gt;
	&amp;lt;/update&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;!-- Site Main File Copy Section --&amp;gt;&lt;br /&gt;
	&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
		to copy FROM in the package to install therefore files copied&lt;br /&gt;
		in this section are copied from /site/ in the package --&amp;gt;&lt;br /&gt;
	&amp;lt;files folder=&amp;quot;site&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;controller.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;views&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;models&amp;lt;/folder&amp;gt;&lt;br /&gt;
	&amp;lt;/files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;administration&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Menu Section --&amp;gt;&lt;br /&gt;
		&amp;lt;menu link=&#039;index.php?option=com_helloworld&#039;&amp;gt;Hello World!&amp;lt;/menu&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Main File Copy Section --&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
			to copy FROM in the package to install therefore files copied&lt;br /&gt;
			in this section are copied from /admin/ in the package --&amp;gt;&lt;br /&gt;
		&amp;lt;files folder=&amp;quot;admin&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;!-- Admin Main File Copy Section --&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;!-- SQL files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;sql&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- tables files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;tables&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- models files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;models&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;/files&amp;gt;&lt;br /&gt;
	&amp;lt;/administration&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
Do the same for the uninstall file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
With your favourite file manager and editor put a file &amp;lt;tt&amp;gt;admin/sql/uninstall.mysql.utf8.sql&amp;lt;/tt&amp;gt; containing:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/sql/uninstall.mysql.utf8.sql&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;admin/sql/uninstall.mysql.utf8.sql&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
DROP TABLE IF EXISTS `#__helloworld`;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;== Adding a new field type == &amp;lt;!--T:13--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
For the moment, we have used a [[S:MyLanguage/J3.3:Developing an MVC Component/Adding a menu type to the site part|hard coded field type for messages]]. We need to use our database for choosing the message, and for this we need to define a custom field type (which we call &#039;&#039;helloworld&#039;&#039; below) as described [https://docs.joomla.org/Creating_a_custom_form_field_type here].&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
Modify the &amp;lt;tt&amp;gt;site/views/helloworld/tmpl/default.xml&amp;lt;/tt&amp;gt; file and put these lines&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/views/helloworld/tmpl/default.xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;site/views/helloworld/tmpl/default.xml&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot; highlight=&amp;quot;8,11-16&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;metadata&amp;gt;&lt;br /&gt;
	&amp;lt;layout title=&amp;quot;COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_TITLE&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;message&amp;gt;COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_DESC&amp;lt;/message&amp;gt;&lt;br /&gt;
	&amp;lt;/layout&amp;gt;&lt;br /&gt;
	&amp;lt;fields&lt;br /&gt;
			name=&amp;quot;request&amp;quot;&lt;br /&gt;
			addfieldpath=&amp;quot;/administrator/components/com_helloworld/models/fields&amp;quot;&lt;br /&gt;
			&amp;gt;&lt;br /&gt;
		&amp;lt;fieldset name=&amp;quot;request&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;field&lt;br /&gt;
					name=&amp;quot;id&amp;quot;&lt;br /&gt;
					type=&amp;quot;helloworld&amp;quot;&lt;br /&gt;
					label=&amp;quot;COM_HELLOWORLD_HELLOWORLD_FIELD_GREETING_LABEL&amp;quot;&lt;br /&gt;
					description=&amp;quot;COM_HELLOWORLD_HELLOWORLD_FIELD_GREETING_DESC&amp;quot;&lt;br /&gt;
					/&amp;gt;&lt;br /&gt;
		&amp;lt;/fieldset&amp;gt;&lt;br /&gt;
	&amp;lt;/fields&amp;gt;&lt;br /&gt;
&amp;lt;/metadata&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
It introduces a new field type and tells Joomla to look for the field definition in the &amp;lt;tt&amp;gt;/administrator/components/com_helloworld/models/fields&amp;lt;/tt&amp;gt; folder.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
In order to learn more on database queries, selecting data from a database table and retrieving it in several formats [[S:MyLanguage/Selecting_data_using_JDatabase|click here]].&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
With your favourite file manager and editor put a file &#039;&#039;admin/models/fields/helloworld.php&#039;&#039; containing:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/models/fields/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;admin/models/fields/helloworld.php&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
JFormHelper::loadFieldClass(&#039;list&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * HelloWorld Form Field class for the HelloWorld component&lt;br /&gt;
 *&lt;br /&gt;
 * @since  0.0.1&lt;br /&gt;
 */&lt;br /&gt;
class JFormFieldHelloWorld extends JFormFieldList&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * The field type.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @var         string&lt;br /&gt;
	 */&lt;br /&gt;
	protected $type = &#039;HelloWorld&#039;;&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Method to get a list of options for a list input.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return  array  An array of JHtml options.&lt;br /&gt;
	 */&lt;br /&gt;
	protected function getOptions()&lt;br /&gt;
	{&lt;br /&gt;
		$db    = JFactory::getDBO();&lt;br /&gt;
		$query = $db-&amp;gt;getQuery(true);&lt;br /&gt;
		$query-&amp;gt;select(&#039;id,greeting&#039;);&lt;br /&gt;
		$query-&amp;gt;from(&#039;#__helloworld&#039;);&lt;br /&gt;
		$db-&amp;gt;setQuery((string) $query);&lt;br /&gt;
		$messages = $db-&amp;gt;loadObjectList();&lt;br /&gt;
		$options  = array();&lt;br /&gt;
&lt;br /&gt;
		if ($messages)&lt;br /&gt;
		{&lt;br /&gt;
			foreach ($messages as $message)&lt;br /&gt;
			{&lt;br /&gt;
				$options[] = JHtml::_(&#039;select.option&#039;, $message-&amp;gt;id, $message-&amp;gt;greeting);&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		$options = array_merge(parent::getOptions(), $options);&lt;br /&gt;
&lt;br /&gt;
		return $options;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
The new field type displays a drop-down list of messages to choose from. You can see the result of this change in the menu manager section for the helloworld item.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;== Display the chosen message == &amp;lt;!--T:20--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
When a menu item of this component is created/updated, Joomla stores the identifier of the message. The &amp;lt;tt&amp;gt;HelloWorldModelHelloWorld&amp;lt;/tt&amp;gt; model has now to compute the message according to this identifier and the data stored in the database. To do this is uses the [https://docs.joomla.org/Using_the_JTable_class JTable] functionality, which is an alternative to JDatabase if only CRUD operations on single records are required.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
Modify the &amp;lt;tt&amp;gt;site/models/helloworld.php&amp;lt;/tt&amp;gt; file:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/models/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;site/models/helloworld.php&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * HelloWorld Model&lt;br /&gt;
 *&lt;br /&gt;
 * @since  0.0.1&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldModelHelloWorld extends JModelItem&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * @var array messages&lt;br /&gt;
	 */&lt;br /&gt;
	protected $messages;&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Method to get a table object, load it if necessary.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @param   string  $type    The table name. Optional.&lt;br /&gt;
	 * @param   string  $prefix  The class prefix. Optional.&lt;br /&gt;
	 * @param   array   $config  Configuration array for model. Optional.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return  JTable  A JTable object&lt;br /&gt;
	 *&lt;br /&gt;
	 * @since   1.6&lt;br /&gt;
	 */&lt;br /&gt;
	public function getTable($type = &#039;HelloWorld&#039;, $prefix = &#039;HelloWorldTable&#039;, $config = array())&lt;br /&gt;
	{&lt;br /&gt;
		return JTable::getInstance($type, $prefix, $config);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Get the message&lt;br /&gt;
	 *&lt;br /&gt;
	 * @param   integer  $id  Greeting Id&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return  string        Fetched String from Table for relevant Id&lt;br /&gt;
	 */&lt;br /&gt;
	public function getMsg($id = 1)&lt;br /&gt;
	{&lt;br /&gt;
		if (!is_array($this-&amp;gt;messages))&lt;br /&gt;
		{&lt;br /&gt;
			$this-&amp;gt;messages = array();&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		if (!isset($this-&amp;gt;messages[$id]))&lt;br /&gt;
		{&lt;br /&gt;
			// Request the selected id&lt;br /&gt;
			$jinput = JFactory::getApplication()-&amp;gt;input;&lt;br /&gt;
			$id     = $jinput-&amp;gt;get(&#039;id&#039;, 1, &#039;INT&#039;);&lt;br /&gt;
&lt;br /&gt;
			// Get a TableHelloWorld instance&lt;br /&gt;
			$table = $this-&amp;gt;getTable();&lt;br /&gt;
&lt;br /&gt;
			// Load the message&lt;br /&gt;
			$table-&amp;gt;load($id);&lt;br /&gt;
&lt;br /&gt;
			// Assign the message&lt;br /&gt;
			$this-&amp;gt;messages[$id] = $table-&amp;gt;greeting;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		return $this-&amp;gt;messages[$id];&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
The model now asks the &#039;&#039;TableHelloWorld&#039;&#039; to get the message. This table class has to be defined in &amp;lt;tt&amp;gt;admin/tables/helloworld.php&amp;lt;/tt&amp;gt; file&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/tables/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;admin/tables/helloworld.php&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
// No direct access&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Hello Table class&lt;br /&gt;
 *&lt;br /&gt;
 * @since  0.0.1&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldTableHelloWorld extends JTable&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * Constructor&lt;br /&gt;
	 *&lt;br /&gt;
	 * @param   JDatabaseDriver  &amp;amp;$db  A database connector object&lt;br /&gt;
	 */&lt;br /&gt;
	function __construct(&amp;amp;$db)&lt;br /&gt;
	{&lt;br /&gt;
		parent::__construct(&#039;#__helloworld&#039;, &#039;id&#039;, $db);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
You shouldn&#039;t see any differences, but if you access the database you should see a table named &#039;&#039;jos_helloworld&#039;&#039; with two columns: id and greeting. And two entries: &#039;&#039;Hello World!&#039;&#039; and &#039;&#039;Good bye World&#039;&#039;.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;== Packaging the component == &amp;lt;!--T:25--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
Content of your code directory&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;[[#helloworld.xml|helloworld.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Adding_a_view_to_the_site_part#site/helloworld.php|site/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|site/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Adding_a_view_to_the_site_part#site/controller.php|site/controller.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|site/views/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|site/views/helloworld/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Adding_a_view_to_the_site_part#site/views/helloworld/view.html.php|site/views/helloworld/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|site/views/helloworld/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#site/views/helloworld/tmpl/default.xml|site/views/helloworld/tmpl/default.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Adding_a_view_to_the_site_part#site/views/helloworld/tmpl/default.php|site/views/helloworld/tmpl/default.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|site/models/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#site/models/helloworld.php|site/models/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|admin/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#admin/helloworld.php|admin/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/sql/install.mysql.utf8.sql|admin/sql/install.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/sql/uninstall.mysql.utf8.sql|admin/sql/uninstall.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/updates/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/updates/mysql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#admin/sql/updates/mysql/0.0.1.sql|admin/sql/updates/mysql/0.0.1.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/sql/install.mysql.utf8.sql|admin/sql/updates/mysql/0.0.6.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|admin/models/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/models/helloworld.php|admin/models/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|admin/models/fields/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/models/fields/helloworld.php|admin/models/fields/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|admin/tables/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/tables/helloworld.php|admin/tables/helloworld.php]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
Create a compressed file of this directory or directly download the [https://github.com/scionescire/Joomla-3.2-Hello-World-Component/archive/step-6-using-the-database.zip archive] and install it using the extension manager of Joomla. You can add a menu item of this component using the menu manager in the backend.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{notice|&amp;lt;translate&amp;gt;&amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
Please create a pull request or issue at https://github.com/joomla/Joomla-3.2-Hello-World-Component for any code discrepancies or if editing any of the source code on this page.&amp;lt;/translate&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
*[[User:cdemko|Christophe Demko]]&lt;br /&gt;
*[[User:oaksu|Ozgur Aksu]]&lt;br /&gt;
*[[User:scionescire|Scionescire]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;row&amp;quot;&amp;gt; &lt;br /&gt;
&amp;lt;div class=&amp;quot;large-6 columns&amp;quot;&amp;gt;{{Basic button|&amp;lt;translate&amp;gt;&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
S:MyLanguage/J3.x:Developing_an_MVC_Component/Adding a variable request in the menu type|Prev: Adding a variable request in the menu type&amp;lt;/translate&amp;gt;|class=expand success}}&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;large-6 columns&amp;quot;&amp;gt;{{Basic button|&amp;lt;translate&amp;gt;&amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
S:MyLanguage/J3.x:Developing_an_MVC_Component/Basic backend|Next: Basic backend&amp;lt;/translate&amp;gt;|class=expand}}&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
[[Category:Joomla! 3.x]]&lt;br /&gt;
[[Category:Joomla! 3.0]]&lt;br /&gt;
[[Category:Joomla! 3.1]]&lt;br /&gt;
[[Category:Joomla! 3.2]]&lt;br /&gt;
[[Category:Joomla! 3.3]]&lt;br /&gt;
[[Category:Joomla! 3.4]]&lt;br /&gt;
[[Category:Beginner Development]]&lt;br /&gt;
[[Category:Component Development]]&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
[[Category:Tutorials in a Series]]&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Honje</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Using_the_database&amp;diff=445057</id>
		<title>J3.x:Developing an MVC Component/Using the database</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Using_the_database&amp;diff=445057"/>
		<updated>2017-09-12T10:17:51Z</updated>

		<summary type="html">&lt;p&gt;Honje: &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;
{{:J3.1:Developing an MVC Component/&amp;lt;translate&amp;gt;&amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
en&amp;lt;/translate&amp;gt;}}&lt;br /&gt;
&amp;lt;translate&amp;gt;== Introduction == &amp;lt;!--T:2--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
This tutorial is part of the [[S:MyLanguage/J3.3:Developing an MVC Component | Developing an MVC Component for Joomla! 3.3]] tutorial. You are encouraged to read the previous parts of the tutorial before reading this. Also while doing this part you are also encouraged to read more on database queries, selecting data from a database table and retrieving it in several formats [[S:MyLanguage/Selecting_data_using_JDatabase|here]].&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:32--&amp;gt; There are also 3 videos associated with this step in the tutorial, covering [https://www.youtube.com/watch?v=JWS_3rx8RzY the Database Setup], [https://www.youtube.com/watch?v=rKEHDeFGlGM Displaying the message (using JTable)] and [https://www.youtube.com/watch?v=uEDNyG6pSEk Admin message selection (and JDatabase)].&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{#widget:YouTube|id=JWS_3rx8RzY}}&lt;br /&gt;
&lt;br /&gt;
{{#widget:YouTube|id=rKEHDeFGlGM}}&lt;br /&gt;
&lt;br /&gt;
{{#widget:YouTube|id=uEDNyG6pSEk}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;== Using the database == &amp;lt;!--T:4--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
Components usually manage their contents using the database. During the install/uninstall/update phase of a component, you can execute SQL queries through the use of SQL text files.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
With your favourite file manager and editor create two files called &amp;lt;tt&amp;gt;admin/sql/install.mysql.utf8.sql&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;admin/sql/updates/mysql/0.0.6.sql&amp;lt;/tt&amp;gt;. They should both have the same content, as follows:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/sql/install.mysql.utf8.sql&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;admin/sql/install.mysql.utf8.sql&#039;&#039;&#039; and &#039;&#039;&#039;admin/sql/updates/mysql/0.0.6.sql&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
DROP TABLE IF EXISTS `#__helloworld`;&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE `#__helloworld` (&lt;br /&gt;
	`id`       INT(11)     NOT NULL AUTO_INCREMENT,&lt;br /&gt;
	`greeting` VARCHAR(25) NOT NULL,&lt;br /&gt;
	`published` tinyint(4) NOT NULL DEFAULT &#039;1&#039;,&lt;br /&gt;
	PRIMARY KEY (`id`)&lt;br /&gt;
)&lt;br /&gt;
	ENGINE =MyISAM&lt;br /&gt;
	AUTO_INCREMENT =0&lt;br /&gt;
	DEFAULT CHARSET =utf8;&lt;br /&gt;
&lt;br /&gt;
INSERT INTO `#__helloworld` (`greeting`) VALUES&lt;br /&gt;
(&#039;Hello World!&#039;),&lt;br /&gt;
(&#039;Good bye World!&#039;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
The file &amp;lt;tt&amp;gt;install.mysql.utf8.sql&amp;lt;/tt&amp;gt; will be executed when you install this component. The file &#039;&#039;0.0.6.sql&#039;&#039; is executed when you do an update.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Important Note:&#039;&#039;&#039; When the component is installed, the files in the SQL updates folder (for example, &#039;&#039;admin/sql/updates/mysql&#039;&#039;) are read and the name of the last file alphabetically is used to populate the component&#039;s version number in the &amp;lt;code&amp;gt;#__schemas&amp;lt;/code&amp;gt; table. This value must be in this table in order for the automatic update to execute the update SQL files for future versions. For this reason, it is good practice to create a SQL update file for each version (even if it is empty or just has a comment). This way the &amp;lt;code&amp;gt;#__schemas&amp;lt;/code&amp;gt; version will always match the component version.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Important Note:&#039;&#039;&#039; When saving the SQL files in utf8, be sure to save them as utf8 NOT BOM or the query will fail with MySQL error #1064.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
This is the install file. It will be executed if you put an appropriate order in the &amp;lt;tt&amp;gt;helloworld.xml&amp;lt;/tt&amp;gt; file.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;helloworld.xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;helloworld.xml&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot; highlight=&amp;quot;13,17-26,58-61&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;extension type=&amp;quot;component&amp;quot; version=&amp;quot;3.2.0&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;name&amp;gt;Hello World!&amp;lt;/name&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The following elements are optional and free of formatting constraints --&amp;gt;&lt;br /&gt;
	&amp;lt;creationDate&amp;gt;January 2014&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
	&amp;lt;author&amp;gt;John Doe&amp;lt;/author&amp;gt;&lt;br /&gt;
	&amp;lt;authorEmail&amp;gt;john.doe@example.org&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
	&amp;lt;authorUrl&amp;gt;http://www.example.org&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
	&amp;lt;copyright&amp;gt;Copyright Info&amp;lt;/copyright&amp;gt;&lt;br /&gt;
	&amp;lt;license&amp;gt;License Info&amp;lt;/license&amp;gt;&lt;br /&gt;
	&amp;lt;!--  The version string is recorded in the components table --&amp;gt;&lt;br /&gt;
	&amp;lt;version&amp;gt;0.0.6&amp;lt;/version&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The description is optional and defaults to the name --&amp;gt;&lt;br /&gt;
	&amp;lt;description&amp;gt;Description of the Hello World component ...&amp;lt;/description&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;install&amp;gt; &amp;lt;!-- Runs on install --&amp;gt;&lt;br /&gt;
		&amp;lt;sql&amp;gt;&lt;br /&gt;
			&amp;lt;file driver=&amp;quot;mysql&amp;quot; charset=&amp;quot;utf8&amp;quot;&amp;gt;sql/install.mysql.utf8.sql&amp;lt;/file&amp;gt;&lt;br /&gt;
		&amp;lt;/sql&amp;gt;&lt;br /&gt;
	&amp;lt;/install&amp;gt;&lt;br /&gt;
	&amp;lt;uninstall&amp;gt; &amp;lt;!-- Runs on uninstall --&amp;gt;&lt;br /&gt;
		&amp;lt;sql&amp;gt;&lt;br /&gt;
			&amp;lt;file driver=&amp;quot;mysql&amp;quot; charset=&amp;quot;utf8&amp;quot;&amp;gt;sql/uninstall.mysql.utf8.sql&amp;lt;/file&amp;gt;&lt;br /&gt;
		&amp;lt;/sql&amp;gt;&lt;br /&gt;
	&amp;lt;/uninstall&amp;gt;&lt;br /&gt;
	&amp;lt;update&amp;gt; &amp;lt;!-- Runs on update; New since J2.5 --&amp;gt;&lt;br /&gt;
		&amp;lt;schemas&amp;gt;&lt;br /&gt;
			&amp;lt;schemapath type=&amp;quot;mysql&amp;quot;&amp;gt;sql/updates/mysql&amp;lt;/schemapath&amp;gt;&lt;br /&gt;
		&amp;lt;/schemas&amp;gt;&lt;br /&gt;
	&amp;lt;/update&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;!-- Site Main File Copy Section --&amp;gt;&lt;br /&gt;
	&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
		to copy FROM in the package to install therefore files copied&lt;br /&gt;
		in this section are copied from /site/ in the package --&amp;gt;&lt;br /&gt;
	&amp;lt;files folder=&amp;quot;site&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;controller.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;views&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;models&amp;lt;/folder&amp;gt;&lt;br /&gt;
	&amp;lt;/files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;administration&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Menu Section --&amp;gt;&lt;br /&gt;
		&amp;lt;menu link=&#039;index.php?option=com_helloworld&#039;&amp;gt;Hello World!&amp;lt;/menu&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Main File Copy Section --&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
			to copy FROM in the package to install therefore files copied&lt;br /&gt;
			in this section are copied from /admin/ in the package --&amp;gt;&lt;br /&gt;
		&amp;lt;files folder=&amp;quot;admin&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;!-- Admin Main File Copy Section --&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;!-- SQL files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;sql&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- tables files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;tables&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- models files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;models&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;/files&amp;gt;&lt;br /&gt;
	&amp;lt;/administration&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
Do the same for the uninstall file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
With your favourite file manager and editor put a file &amp;lt;tt&amp;gt;admin/sql/uninstall.mysql.utf8.sql&amp;lt;/tt&amp;gt; containing:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/sql/uninstall.mysql.utf8.sql&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;admin/sql/uninstall.mysql.utf8.sql&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
DROP TABLE IF EXISTS `#__helloworld`;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;== Adding a new field type == &amp;lt;!--T:13--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
For the moment, we have used a [[S:MyLanguage/J3.3:Developing an MVC Component/Adding a menu type to the site part|hard coded field type for messages]]. We need to use our database for choosing the message, and for this we need to define a custom field type (which we call &#039;&#039;helloworld&#039;&#039; below) as described [https://docs.joomla.org/Creating_a_custom_form_field_type here].&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
Modify the &amp;lt;tt&amp;gt;site/views/helloworld/tmpl/default.xml&amp;lt;/tt&amp;gt; file and put these lines&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/views/helloworld/tmpl/default.xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;site/views/helloworld/tmpl/default.xml&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot; highlight=&amp;quot;8,11-16&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;metadata&amp;gt;&lt;br /&gt;
	&amp;lt;layout title=&amp;quot;COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_TITLE&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;message&amp;gt;COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_DESC&amp;lt;/message&amp;gt;&lt;br /&gt;
	&amp;lt;/layout&amp;gt;&lt;br /&gt;
	&amp;lt;fields&lt;br /&gt;
			name=&amp;quot;request&amp;quot;&lt;br /&gt;
			addfieldpath=&amp;quot;/administrator/components/com_helloworld/models/fields&amp;quot;&lt;br /&gt;
			&amp;gt;&lt;br /&gt;
		&amp;lt;fieldset name=&amp;quot;request&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;field&lt;br /&gt;
					name=&amp;quot;id&amp;quot;&lt;br /&gt;
					type=&amp;quot;helloworld&amp;quot;&lt;br /&gt;
					label=&amp;quot;COM_HELLOWORLD_HELLOWORLD_FIELD_GREETING_LABEL&amp;quot;&lt;br /&gt;
					description=&amp;quot;COM_HELLOWORLD_HELLOWORLD_FIELD_GREETING_DESC&amp;quot;&lt;br /&gt;
					/&amp;gt;&lt;br /&gt;
		&amp;lt;/fieldset&amp;gt;&lt;br /&gt;
	&amp;lt;/fields&amp;gt;&lt;br /&gt;
&amp;lt;/metadata&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
It introduces a new field type and tells Joomla to look for the field definition in the &amp;lt;tt&amp;gt;/administrator/components/com_helloworld/models/fields&amp;lt;/tt&amp;gt; folder.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
In order to learn more on database queries, selecting data from a database table and retrieving it in several formats [[S:MyLanguage/Selecting_data_using_JDatabase|click here]].&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
With your favourite file manager and editor put a file &#039;&#039;admin/models/fields/helloworld.php&#039;&#039; containing:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/models/fields/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;admin/models/fields/helloworld.php&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
JFormHelper::loadFieldClass(&#039;list&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * HelloWorld Form Field class for the HelloWorld component&lt;br /&gt;
 *&lt;br /&gt;
 * @since  0.0.1&lt;br /&gt;
 */&lt;br /&gt;
class JFormFieldHelloWorld extends JFormFieldList&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * The field type.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @var         string&lt;br /&gt;
	 */&lt;br /&gt;
	protected $type = &#039;HelloWorld&#039;;&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Method to get a list of options for a list input.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return  array  An array of JHtml options.&lt;br /&gt;
	 */&lt;br /&gt;
	protected function getOptions()&lt;br /&gt;
	{&lt;br /&gt;
		$db    = JFactory::getDBO();&lt;br /&gt;
		$query = $db-&amp;gt;getQuery(true);&lt;br /&gt;
		$query-&amp;gt;select(&#039;id,greeting&#039;);&lt;br /&gt;
		$query-&amp;gt;from(&#039;#__helloworld&#039;);&lt;br /&gt;
		$db-&amp;gt;setQuery((string) $query);&lt;br /&gt;
		$messages = $db-&amp;gt;loadObjectList();&lt;br /&gt;
		$options  = array();&lt;br /&gt;
&lt;br /&gt;
		if ($messages)&lt;br /&gt;
		{&lt;br /&gt;
			foreach ($messages as $message)&lt;br /&gt;
			{&lt;br /&gt;
				$options[] = JHtml::_(&#039;select.option&#039;, $message-&amp;gt;id, $message-&amp;gt;greeting);&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		$options = array_merge(parent::getOptions(), $options);&lt;br /&gt;
&lt;br /&gt;
		return $options;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
The new field type displays a drop-down list of messages to choose from. You can see the result of this change in the menu manager section for the helloworld item.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;== Display the chosen message == &amp;lt;!--T:20--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
When a menu item of this component is created/updated, Joomla stores the identifier of the message. The &amp;lt;tt&amp;gt;HelloWorldModelHelloWorld&amp;lt;/tt&amp;gt; model has now to compute the message according to this identifier and the data stored in the database. To do this is uses the [https://docs.joomla.org/Using_the_JTable_class JTable] functionality, which is an alternative to JDatabase if only CRUD operations on single records are required.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
Modify the &amp;lt;tt&amp;gt;site/models/helloworld.php&amp;lt;/tt&amp;gt; file:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/models/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;site/models/helloworld.php&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * HelloWorld Model&lt;br /&gt;
 *&lt;br /&gt;
 * @since  0.0.1&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldModelHelloWorld extends JModelItem&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * @var array messages&lt;br /&gt;
	 */&lt;br /&gt;
	protected $messages;&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Method to get a table object, load it if necessary.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @param   string  $type    The table name. Optional.&lt;br /&gt;
	 * @param   string  $prefix  The class prefix. Optional.&lt;br /&gt;
	 * @param   array   $config  Configuration array for model. Optional.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return  JTable  A JTable object&lt;br /&gt;
	 *&lt;br /&gt;
	 * @since   1.6&lt;br /&gt;
	 */&lt;br /&gt;
	public function getTable($type = &#039;HelloWorld&#039;, $prefix = &#039;HelloWorldTable&#039;, $config = array())&lt;br /&gt;
	{&lt;br /&gt;
		return JTable::getInstance($type, $prefix, $config);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Get the message&lt;br /&gt;
	 *&lt;br /&gt;
	 * @param   integer  $id  Greeting Id&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return  string        Fetched String from Table for relevant Id&lt;br /&gt;
	 */&lt;br /&gt;
	public function getMsg($id = 1)&lt;br /&gt;
	{&lt;br /&gt;
		if (!is_array($this-&amp;gt;messages))&lt;br /&gt;
		{&lt;br /&gt;
			$this-&amp;gt;messages = array();&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		if (!isset($this-&amp;gt;messages[$id]))&lt;br /&gt;
		{&lt;br /&gt;
			// Request the selected id&lt;br /&gt;
			$jinput = JFactory::getApplication()-&amp;gt;input;&lt;br /&gt;
			$id     = $jinput-&amp;gt;get(&#039;id&#039;, 1, &#039;INT&#039;);&lt;br /&gt;
&lt;br /&gt;
			// Get a TableHelloWorld instance&lt;br /&gt;
			$table = $this-&amp;gt;getTable();&lt;br /&gt;
&lt;br /&gt;
			// Load the message&lt;br /&gt;
			$table-&amp;gt;load($id);&lt;br /&gt;
&lt;br /&gt;
			// Assign the message&lt;br /&gt;
			$this-&amp;gt;messages[$id] = $table-&amp;gt;greeting;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		return $this-&amp;gt;messages[$id];&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
The model now asks the &#039;&#039;TableHelloWorld&#039;&#039; to get the message. This table class has to be defined in &amp;lt;tt&amp;gt;admin/tables/helloworld.php&amp;lt;/tt&amp;gt; file&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/tables/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;admin/tables/helloworld.php&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
// No direct access&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Hello Table class&lt;br /&gt;
 *&lt;br /&gt;
 * @since  0.0.1&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldTableHelloWorld extends JTable&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * Constructor&lt;br /&gt;
	 *&lt;br /&gt;
	 * @param   JDatabaseDriver  &amp;amp;$db  A database connector object&lt;br /&gt;
	 */&lt;br /&gt;
	function __construct(&amp;amp;$db)&lt;br /&gt;
	{&lt;br /&gt;
		parent::__construct(&#039;#__helloworld&#039;, &#039;id&#039;, $db);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
You shouldn&#039;t see any differences, but if you access the database you should see a table named &#039;&#039;jos_helloworld&#039;&#039; with two columns: id and greeting. And two entries: &#039;&#039;Hello World!&#039;&#039; and &#039;&#039;Good bye World&#039;&#039;.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;== Packaging the component == &amp;lt;!--T:25--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
Content of your code directory&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;[[#helloworld.xml|helloworld.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Adding_a_view_to_the_site_part#site/helloworld.php|site/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|site/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Adding_a_view_to_the_site_part#site/controller.php|site/controller.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|site/views/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|site/views/helloworld/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Adding_a_view_to_the_site_part#site/views/helloworld/view.html.php|site/views/helloworld/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|site/views/helloworld/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#site/views/helloworld/tmpl/default.xml|site/views/helloworld/tmpl/default.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Adding_a_view_to_the_site_part#site/views/helloworld/tmpl/default.php|site/views/helloworld/tmpl/default.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|site/models/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#site/models/helloworld.php|site/models/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|admin/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#admin/helloworld.php|admin/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/sql/install.mysql.utf8.sql|admin/sql/install.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/sql/uninstall.mysql.utf8.sql|admin/sql/uninstall.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/updates/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/updates/mysql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#admin/sql/updates/mysql/0.0.1.sql|admin/sql/updates/mysql/0.0.1.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/sql/install.mysql.utf8.sql|admin/sql/updates/mysql/0.0.6.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|admin/models/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/models/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|admin/models/fields/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/models/fields/helloworld.php|admin/models/fields/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|admin/tables/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/tables/helloworld.php|admin/tables/helloworld.php]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
Create a compressed file of this directory or directly download the [https://github.com/scionescire/Joomla-3.2-Hello-World-Component/archive/step-6-using-the-database.zip archive] and install it using the extension manager of Joomla. You can add a menu item of this component using the menu manager in the backend.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{notice|&amp;lt;translate&amp;gt;&amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
Please create a pull request or issue at https://github.com/joomla/Joomla-3.2-Hello-World-Component for any code discrepancies or if editing any of the source code on this page.&amp;lt;/translate&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
*[[User:cdemko|Christophe Demko]]&lt;br /&gt;
*[[User:oaksu|Ozgur Aksu]]&lt;br /&gt;
*[[User:scionescire|Scionescire]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;row&amp;quot;&amp;gt; &lt;br /&gt;
&amp;lt;div class=&amp;quot;large-6 columns&amp;quot;&amp;gt;{{Basic button|&amp;lt;translate&amp;gt;&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
S:MyLanguage/J3.x:Developing_an_MVC_Component/Adding a variable request in the menu type|Prev: Adding a variable request in the menu type&amp;lt;/translate&amp;gt;|class=expand success}}&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;large-6 columns&amp;quot;&amp;gt;{{Basic button|&amp;lt;translate&amp;gt;&amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
S:MyLanguage/J3.x:Developing_an_MVC_Component/Basic backend|Next: Basic backend&amp;lt;/translate&amp;gt;|class=expand}}&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
[[Category:Joomla! 3.x]]&lt;br /&gt;
[[Category:Joomla! 3.0]]&lt;br /&gt;
[[Category:Joomla! 3.1]]&lt;br /&gt;
[[Category:Joomla! 3.2]]&lt;br /&gt;
[[Category:Joomla! 3.3]]&lt;br /&gt;
[[Category:Joomla! 3.4]]&lt;br /&gt;
[[Category:Beginner Development]]&lt;br /&gt;
[[Category:Component Development]]&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
[[Category:Tutorials in a Series]]&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Honje</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Deploying_an_Update_Server&amp;diff=443223</id>
		<title>Deploying an Update Server</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Deploying_an_Update_Server&amp;diff=443223"/>
		<updated>2017-08-22T14:05:25Z</updated>

		<summary type="html">&lt;p&gt;Honje: &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;
&amp;lt;noinclude&amp;gt;{{Joomla version|version=2.5|status=eos}}{{Joomla version|version=3.x|}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Introduction == &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
This tutorial is designed to teach developers how to create an update server for integration with the update system introduced in Joomla!.  By adding an update server listing to your extension&#039;s manifest, developers enable users to update their extensions via the Extension Manager&#039;s Update (see [[S:MyLanguage/Help31:Extensions Extension Manager Update|Joomla 3.x]] helpscreen) view with only a few clicks.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Defining an update server == &amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
In order to use this feature, an update server must be defined in your extension&#039;s manifest.  This definition can be used in all Joomla! 2.5 and newer compatible extensions but is not available for templates.  You can use two options for your server type; collection or extension.  These will be explained in detail shortly.  This code should be added to the extension manifest file, within the root &amp;quot;extension&amp;quot; element. The update server is defined as follows for each type:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;extension&amp;gt;&lt;br /&gt;
 &amp;lt;...&amp;gt;&lt;br /&gt;
 &amp;lt;updateservers&amp;gt;&lt;br /&gt;
    &amp;lt;server type=&amp;quot;collection&amp;quot;&amp;gt;https://example.com/list.xml&amp;lt;/server&amp;gt;&lt;br /&gt;
    &amp;lt;server type=&amp;quot;extension&amp;quot; priority=&amp;quot;2&amp;quot; name=&amp;quot;My Extension&#039;s Updates&amp;quot;&amp;gt;http://example.com/extension.xml&amp;lt;/server&amp;gt;&lt;br /&gt;
 &amp;lt;/updateservers&amp;gt;&lt;br /&gt;
 &amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
Multiple servers can be defined within the &amp;lt;updateservers&amp;gt; tag.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Server types == &amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Collection === &amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
The collection server type allows developers to define an extension&#039;s manifest to pull updates from a collection.  This type of server can be used if the developer wants to define all of their extension&#039;s updates in a single file (not recommended) or if their extension has multiple sub-extensions which are not distributed or updated at the same time (such as a package extension type).  The below example is the collection definition used by the updater when processing core Joomla! updates:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;extensionset name=&amp;quot;Joomla Core&amp;quot; description=&amp;quot;Joomla! Core&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;extension name=&amp;quot;Joomla&amp;quot; element=&amp;quot;joomla&amp;quot; type=&amp;quot;file&amp;quot; version=&amp;quot;1.7.0&amp;quot; detailsurl=&amp;quot;https://update.joomla.org/core/extension.xml&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/extensionset&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
All definitions must be defined between &amp;lt;extensionset&amp;gt; tags in your collection manifest.  The &amp;lt;extensionset&amp;gt; tag has two optional parameters; name and description.  For each extension that this collection references, a separate &amp;lt;extension&amp;gt; tag is required.  The &amp;lt;extension&amp;gt; tag has the following parameters, all of which are required for updates to properly process:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;name&#039;&#039;&#039; - The name of the extension&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;element&#039;&#039;&#039; - The untranslated extension name i.e. mod_custom&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;type&#039;&#039;&#039; - The extension type (component, module, plugin, etc.)&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;version&#039;&#039;&#039; - The latest version of the extension&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;detailsurl&#039;&#039;&#039; - The URL of the XML file which contains that extension&#039;s individual update definitions&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Extension === &amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
The extension server type allows developers to define an extension&#039;s manifest to pull updates from a single extension&#039;s manifest.  All collection manifests eventually point to this XML file.  All updates in this file must be defined after an &amp;lt;updates&amp;gt; tag at the beginning of the file.  The below example is the update definition for the Joomla! 3.6.5 release:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;updates&amp;gt;&lt;br /&gt;
	&amp;lt;update&amp;gt;&lt;br /&gt;
		&amp;lt;name&amp;gt;Joomla! 3.6&amp;lt;/name&amp;gt;&lt;br /&gt;
		&amp;lt;description&amp;gt;Joomla! 3.6 CMS&amp;lt;/description&amp;gt;&lt;br /&gt;
		&amp;lt;element&amp;gt;joomla&amp;lt;/element&amp;gt;&lt;br /&gt;
		&amp;lt;type&amp;gt;file&amp;lt;/type&amp;gt;&lt;br /&gt;
		&amp;lt;version&amp;gt;3.6.5&amp;lt;/version&amp;gt;&lt;br /&gt;
		&amp;lt;infourl title=&amp;quot;Joomla!&amp;quot;&amp;gt;https://www.joomla.org/announcements/release-news/5693-joomla-3-6-5-released.html&amp;lt;/infourl&amp;gt;&lt;br /&gt;
		&amp;lt;downloads&amp;gt;&lt;br /&gt;
			&amp;lt;downloadurl type=&amp;quot;full&amp;quot; format=&amp;quot;zip&amp;quot;&amp;gt;https://downloads.joomla.org/cms/joomla3/3-6-5/Joomla_3.6.5-Stable-Update_Package.zip&amp;lt;/downloadurl&amp;gt;&lt;br /&gt;
		&amp;lt;/downloads&amp;gt;&lt;br /&gt;
		&amp;lt;tags&amp;gt;&lt;br /&gt;
			&amp;lt;tag&amp;gt;stable&amp;lt;/tag&amp;gt;&lt;br /&gt;
		&amp;lt;/tags&amp;gt;&lt;br /&gt;
		&amp;lt;maintainer&amp;gt;Joomla! PLT&amp;lt;/maintainer&amp;gt;&lt;br /&gt;
		&amp;lt;maintainerurl&amp;gt;https://www.joomla.org&amp;lt;/maintainerurl&amp;gt;&lt;br /&gt;
		&amp;lt;section&amp;gt;STS&amp;lt;/section&amp;gt;&lt;br /&gt;
		&amp;lt;targetplatform name=&amp;quot;joomla&amp;quot; version=&amp;quot;3.[234567]&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;php_minimum&amp;gt;5.3.10&amp;lt;/php_minimum&amp;gt;&lt;br /&gt;
	&amp;lt;/update&amp;gt;&lt;br /&gt;
&amp;lt;/updates&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
The following section describes the elements of a single update entity.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;name&#039;&#039;&#039; - The name of the extension, this name will appear in the Name column of the Extension Manager&#039;s Update view (required)&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;description&#039;&#039;&#039; - A short description of the extension (optional) -- if you choose to use &amp;lt;![CDATA[]]&amp;gt;, double-quotes will break the HTML formatting.  Use single quotes with your HTML entities.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;element&#039;&#039;&#039; - The installed name of the extension (required). For plugins, this needs to be same as plugin attribute value for main file in plugin manifest. For &amp;lt;filename plugin=&amp;quot;pluginname&amp;quot;&amp;gt;pluginname.php&amp;lt;/filename&amp;gt;, element value should be &#039;&#039;&#039;pluginname&#039;&#039;&#039;.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;type&#039;&#039;&#039; - The type of extension (component, module, plugin, etc.) (required)&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;folder&#039;&#039;&#039; - Specific to plugins, this tag describes the type of plugin being updated (content, system, etc.) (required for plugins)&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;client&#039;&#039;&#039; - Required for modules and templates as of 3.2.0. - The client ID of the extension, which can be found by looking inside the #__extensions table. To date, use 0 for &amp;quot;site&amp;quot; and 1 for &amp;quot;administrator&amp;quot;. Plugins and front-end modules are automatically installed with a client of 0 (site), but you will need to specify the client in an update or it will default to 1 (administrator) and then found update would not be shown because it would not match any extension. Components are automatically installed with a client of 1, which is currently the default.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
** &#039;&#039;Warning&#039;&#039;: The tag name is &amp;lt;&#039;&#039;&#039;client&#039;&#039;&#039;&amp;gt; for Joomla! 2.5 and &amp;lt;&#039;&#039;&#039;client_id&#039;&#039;&#039;&amp;gt; for 1.6 and 1.7. If you use &amp;lt;client_id&amp;gt; (rather than &amp;lt;client&amp;gt;) on a 2.5 site, it will be ignored.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;version&#039;&#039;&#039; - The version of the release (required)&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;infourl&#039;&#039;&#039; - A URL to point users to containing information about the update (optional) (In CMS 2.5, if set, this URL will be displayed in the update view)&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;downloads&#039;&#039;&#039; - The section which lists all download locations&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
** &#039;&#039;&#039;downloadurl&#039;&#039;&#039; - The URL to download the extension from; the &amp;lt;downloadurl&amp;gt; tag has two required parameters:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
*** &#039;&#039;&#039;type&#039;&#039;&#039; - The type of package (full or upgrade)&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
*** &#039;&#039;&#039;format&#039;&#039;&#039; - The format of the package (zip, tar, etc.)&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
** &#039;&#039;&#039;NB&#039;&#039;&#039; - there must be no newline before or after the URL; it needs to all be on one line or you will get Error connecting to the server: malformed when the update is run&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;tags&#039;&#039;&#039; - A list of tags relevant to this version. Joomla! 3.4 and later uses this to determine the stability level of the update. The valid tags are:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
** &#039;&#039;dev&#039;&#039;: Development versions, very unstable and pre-alpha (e.g. nightly builds)&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
** &#039;&#039;alpha&#039;&#039;: Alpha quality software (features not implemented, show-stopper bugs)&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
** &#039;&#039;beta&#039;&#039;: Beta quality software (all features implemented, show-stopper bugs possible, minor bugs almost certain)&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
** &#039;&#039;rc&#039;&#039;: Release Candidate quality software (no show-stopper bugs, minor bugs may still be present)&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
** &#039;&#039;stable&#039;&#039;: Production quality software All other tags are currently ignored. If you provide more than one tag containing one of the aforementioned stability keywords only the LAST tag will be taken into account. If you do not provide any tags Joomla! will assume it is a stable version&amp;lt;/translate&amp;gt;.&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;maintainer&#039;&#039;&#039; - The name of the extension maintainer (similar to the &amp;lt;author&amp;gt; tag in a manifest) (optional)&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;maintainerurl&#039;&#039;&#039; - The website of the extension maintainer (similar to the &amp;lt;authorUrl&amp;gt; tag in a manifest) (optional)&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;section&#039;&#039;&#039; - Optional (unknown use)&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;targetplatform&#039;&#039;&#039; - A tag to define platform requirements, requires the following elementsː&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
** &#039;&#039;&#039;name&#039;&#039;&#039; - The name of the platform dependency; as of this writing, it should ONLY be &amp;quot;joomla&amp;quot;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
** &#039;&#039;&#039;version&#039;&#039;&#039; - The version of Joomla! the extension supports&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
** &#039;&#039;&#039;min_dev_level&#039;&#039;&#039; and &#039;&#039;&#039;max_dev_level&#039;&#039;&#039; - These attributes were added in 3.0.1 to allow you to select a target platform based on the developer level (&amp;quot;z&amp;quot; in x.y.z). They are optional. You can specify either one or both. If omitted, all developer levels are matched. For example, the following matches versions 4.0.0 and 4.0.1. &amp;lt;code&amp;gt;&amp;lt;targetplatform name=&amp;quot;joomla&amp;quot; version=&amp;quot;4.0&amp;quot; min_dev_level=&amp;quot;0&amp;quot; max_dev_level=&amp;quot;1&amp;quot;/&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
*** &#039;&#039;&#039;Note:&#039;&#039;&#039; If your extension is Joomla! 2.5 and/or 3.1 compatible, you will be required to have separate &amp;lt;update&amp;gt; definitions for each version due to the manner in which the updater checks the version if you specify a number. However to show your extension on all Joomla versions that support automatic updates add &amp;lt;code&amp;gt;&amp;lt;targetplatform name=&amp;quot;joomla&amp;quot; version=&amp;quot;.*&amp;quot;/&amp;gt;&amp;lt;/code&amp;gt;. If you want your extension to show on all {{JVer|3.x}} versions then rather than specifying a version in the version tag add in &amp;lt;code&amp;gt;&amp;lt;targetplatform name=&amp;quot;joomla&amp;quot; version=&amp;quot;3.[012345]&amp;quot;/&amp;gt;&amp;lt;/code&amp;gt;. This will show the update to all 3.x versions.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;php_minimum&#039;&#039;&#039; - Beginning with 3.2.2, a minimum supported PHP version can be supplied in the update stream.  If the server does not meet the minimum, a message is displayed to the user advising that an update is available but cannot be installed due to unsupported requirements.&amp;lt;/translate&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;supported_databases&#039;&#039;&#039; - Beginning with 3.7, a minimum supported Databases + version can be supplied in the update stream.  If the server does not meet the minimum, a message is displayed to the user advising that an update is available but cannot be installed due to unsupported requirements.&lt;br /&gt;
** An example could look like this: &amp;lt;code&amp;gt;&amp;lt;supported_databases mysql=&amp;quot;5.5.3&amp;quot; postgresql=&amp;quot;9.2&amp;quot; mssql=&amp;quot;10.50.1600.1&amp;quot; /&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:47--&amp;gt;&lt;br /&gt;
A separate &amp;lt;update&amp;gt; definition will be required for each version of your extension you release.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
The values of &#039;&#039;&#039;element&#039;&#039;&#039;, &#039;&#039;&#039;type&#039;&#039;&#039;, &#039;&#039;&#039;client_id&#039;&#039;&#039; and &#039;&#039;&#039;folder&#039;&#039;&#039; should match those in the table #__extensions.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Important for plugins:&#039;&#039;&#039; Plugins have to include &amp;lt;folder&amp;gt; and &amp;lt;client&amp;gt; elements to work properly&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Troubleshooting == &amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;SQL update script is not executed during update.&#039;&#039;&#039;&amp;lt;/translate&amp;gt; &lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
:If the SQL update script (for example, in the folder &amp;lt;code&amp;gt;sql/updates/mysql&amp;lt;/code&amp;gt;) does not get executed during the update process, it could be because there is no version number in the &amp;lt;code&amp;gt;#__schemas&amp;lt;/code&amp;gt; table for this extension &#039;&#039;prior to the update&#039;&#039;. This value is determined by the last script name in the SQL updates folder. If this value is blank, no SQL scripts will be executed during that update cycle. To make sure this value is set correctly, make sure you have a SQL script in this folder with its name as the version number (for example, 1.2.3.sql if the version is 1.2.3). The file can be empty or just have a SQL comment line. This should be done in the old version -- the one before the update. Alternatively, you can add this value to the &amp;lt;code&amp;gt;#__schemas&amp;lt;/code&amp;gt; using a SQL query.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Supporting Tools == &amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&amp;lt;translate&amp;gt;&amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
[[Category:Development]]&amp;lt;/translate&amp;gt;&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Honje</name></author>
	</entry>
</feed>