<?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=Bobbravo2</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=Bobbravo2"/>
	<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/Special:Contributions/Bobbravo2"/>
	<updated>2026-08-14T02:01:17Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Selecting_data_using_JDatabase&amp;diff=106396</id>
		<title>Selecting data using JDatabase</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Selecting_data_using_JDatabase&amp;diff=106396"/>
		<updated>2013-12-10T22:37:21Z</updated>

		<summary type="html">&lt;p&gt;Bobbravo2: /* Miscellaneous Result Set Methods */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{version|2.5,3.x}}&lt;br /&gt;
{{dablink|&#039;&#039;&#039;Version Note:&#039;&#039;&#039; While this document pertains to Joomla! 2.5 and 3.x, &amp;lt;code&amp;gt;$db-&amp;gt;query()&amp;lt;/code&amp;gt; throws a deprecated notice in Joomla 3.0+. In that case, change &amp;lt;code&amp;gt;$db-&amp;gt;query()&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;$db-&amp;gt;execute()&amp;lt;/code&amp;gt;. However note &amp;lt;code&amp;gt;$db-&amp;gt;execute()&amp;lt;/code&amp;gt; does not work in Joomla 2.5.}}&lt;br /&gt;
&lt;br /&gt;
This tutorial is split into two independent parts:&lt;br /&gt;
* Inserting, updating and removing data from the database.&lt;br /&gt;
* Selecting data from one or more tables and retrieving it in a variety of different forms&lt;br /&gt;
&lt;br /&gt;
This section of the documentation looks at selecting data from a database table and retrieving it in a variety of formats. To see the other part [[Inserting,_Updating_and_Removing_data_using_JDatabase|click here]]&lt;br /&gt;
&lt;br /&gt;
== Introduction==&lt;br /&gt;
Joomla provides a sophisticated database abstraction layer to simplify the usage for third party developers. New versions of the Joomla Platform API provide additional functionality which extends the database layer further, and includes features such as connectors to a greater variety of database servers and the query chaining to improve readability of connection code and simplify SQL coding.&lt;br /&gt;
&lt;br /&gt;
Joomla can use different kinds of SQL database systems and run in a variety of environments with different table-prefixes. In addition to these functions, the class automatically creates the database connection. Besides instantiating the object you need just two lines of code to get a result from the database in a variety of formats. Using the Joomla database layer ensures a maximum of compatibility and flexibility for your extension.&lt;br /&gt;
&lt;br /&gt;
==The Query==&lt;br /&gt;
&lt;br /&gt;
Joomla&#039;s database querying has changed since the new Joomla Framework was introduced  &amp;quot;query chaining&amp;quot; is now the recommended method for building database queries (although string queries are still supported).&lt;br /&gt;
&lt;br /&gt;
Query chaining refers to a method of connecting a number of methods, one after the other, with each method returning an object that can support the next method, improving readability and simplifying code.&lt;br /&gt;
&lt;br /&gt;
To obtain a new instance of the JDatabaseQuery class we use the JDatabaseDriver getQuery method:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$db = JFactory::getDbo();&lt;br /&gt;
&lt;br /&gt;
$query = $db-&amp;gt;getQuery(true);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The JDatabaseDriver::getQuery takes an optional argument, $new, which can be true or false (the default being false).&lt;br /&gt;
&lt;br /&gt;
To query our data source we can call a number of JDatabaseQuery methods; these methods encapsulate the data source&#039;s query language (in most cases SQL), hiding query-specific syntax from the developer and increasing the portability of the developer&#039;s source code. &lt;br /&gt;
&lt;br /&gt;
Some of the more frequently used methods include; select, from, join, where and order. There are also methods such as insert, update and delete for modifying records in the data store. By chaining these and other method calls, you can create almost any query against your data store without compromising portability of your code.&lt;br /&gt;
&lt;br /&gt;
==Selecting Records from a Single Table==&lt;br /&gt;
&lt;br /&gt;
Below is an example of creating a database query using the JDatabaseQuery class. Using the select, from, where and order methods, we can create queries which are flexible, easily readable and portable:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
// Get a db connection.&lt;br /&gt;
$db = JFactory::getDbo();&lt;br /&gt;
&lt;br /&gt;
// Create a new query object.&lt;br /&gt;
$query = $db-&amp;gt;getQuery(true);&lt;br /&gt;
&lt;br /&gt;
// Select all records from the user profile table where key begins with &amp;quot;custom.&amp;quot;.&lt;br /&gt;
// Order it by the ordering field.&lt;br /&gt;
$query-&amp;gt;select($db-&amp;gt;quoteName(array(&#039;user_id&#039;, &#039;profile_key&#039;, &#039;profile_value&#039;, &#039;ordering&#039;)));&lt;br /&gt;
$query-&amp;gt;from($db-&amp;gt;quoteName(&#039;#__user_profiles&#039;));&lt;br /&gt;
$query-&amp;gt;where($db-&amp;gt;quoteName(&#039;profile_key&#039;) . &#039; LIKE &#039;. $db-&amp;gt;quote(&#039;\&#039;custom.%\&#039;&#039;));&lt;br /&gt;
$query-&amp;gt;order(&#039;ordering ASC&#039;);&lt;br /&gt;
&lt;br /&gt;
// Reset the query using our newly populated query object.&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
&lt;br /&gt;
// Load the results as a list of stdClass objects (see later for more options on retrieving data).&lt;br /&gt;
$results = $db-&amp;gt;loadObjectList();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The query can also be chained to simplify further:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$query&lt;br /&gt;
    -&amp;gt;select($db-&amp;gt;quoteName(array(&#039;user_id&#039;, &#039;profile_key&#039;, &#039;profile_value&#039;, &#039;ordering&#039;)))&lt;br /&gt;
    -&amp;gt;from($db-&amp;gt;quoteName(&#039;#__user_profiles&#039;))&lt;br /&gt;
    -&amp;gt;where($db-&amp;gt;quoteName(&#039;profile_key&#039;) . &#039; LIKE &#039;. $db-&amp;gt;quote(&#039;\&#039;custom.%\&#039;&#039;))&lt;br /&gt;
    -&amp;gt;order(&#039;ordering ASC&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Chaining can become useful when queries become longer and more complex.&lt;br /&gt;
&lt;br /&gt;
Grouping can be achieved simply too.  The following query would count the number of articles in each category&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$query&lt;br /&gt;
    -&amp;gt;select( array(&#039;catid&#039;, &#039;COUNT(*)&#039;) )&lt;br /&gt;
    -&amp;gt;from($db-&amp;gt;quoteName(&#039;#__content&#039;))&lt;br /&gt;
    -&amp;gt;group($db-&amp;gt;quoteName(&#039;catid&#039;));&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Selecting Records from Multiple Tables==&lt;br /&gt;
&lt;br /&gt;
Using the JDatabaseQuery&#039;s [http://api.joomla.org/Joomla-Platform/Database/JDatabaseQuery.html#join join] methods, we can select records from multiple related tables. The generic &amp;quot;join&amp;quot; method takes two arguments; the join &amp;quot;type&amp;quot; (inner, outer, left, right) and the join condition. In the following example you will notice that we can use all of the keywords we would normally use if we were writing a native SQL query, including the AS keyword for aliasing tables and the ON keyword for creating relationships between tables. Also note that the table alias is used in all methods which reference table columns (I.e. select, where, order).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
// Get a db connection.&lt;br /&gt;
$db = JFactory::getDbo();&lt;br /&gt;
&lt;br /&gt;
// Create a new query object.&lt;br /&gt;
$query = $db-&amp;gt;getQuery(true);&lt;br /&gt;
&lt;br /&gt;
// Select all articles for users who have a username which starts with &#039;a&#039;.&lt;br /&gt;
// Order it by the created date.&lt;br /&gt;
// Note by putting &#039;a&#039; as a second parameter will generate `#__content` AS `a`&lt;br /&gt;
$query&lt;br /&gt;
    -&amp;gt;select($db-&amp;gt;quoteName(array(&#039;a.*&#039;, &#039;b.username&#039;, &#039;b.name&#039;)))&lt;br /&gt;
    -&amp;gt;from($db-&amp;gt;quoteName(&#039;#__content&#039;, &#039;a&#039;))&lt;br /&gt;
    -&amp;gt;join(&#039;INNER&#039;, $db-&amp;gt;quoteName(&#039;#__users&#039;, &#039;b&#039;) . &#039; ON (&#039; . $db-&amp;gt;quoteName(&#039;a.created_by&#039;) . &#039; = &#039; . $db-&amp;gt;quoteName(&#039;b.id&#039;) . &#039;)&#039;)&lt;br /&gt;
    -&amp;gt;where($db-&amp;gt;quoteName(&#039;b.username&#039;) . &#039; LIKE \&#039;a%\&#039;&#039;)&lt;br /&gt;
    -&amp;gt;order($db-&amp;gt;quoteName(&#039;a.created&#039;) . &#039; DESC&#039;);&lt;br /&gt;
&lt;br /&gt;
// Reset the query using our newly populated query object.&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
&lt;br /&gt;
// Load the results as a list of stdClass objects (see later for more options on retrieving data).&lt;br /&gt;
$results = $db-&amp;gt;loadObjectList();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The join method above enables us to query both the content and user tables, retrieving articles with their author details. There are also convenience methods for [http://api.joomla.org/Joomla-Platform/Database/JDatabaseQuery.html#innerJoin inner], [http://api.joomla.org/Joomla-Platform/Database/JDatabaseQuery.html#leftJoin left], [http://api.joomla.org/Joomla-Platform/Database/JDatabaseQuery.html#rightJoin right] and [http://api.joomla.org/Joomla-Platform/Database/JDatabaseQuery.html#outerJoin outer] joins.&lt;br /&gt;
&lt;br /&gt;
We can use multiple joins to query across more than two tables:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$query&lt;br /&gt;
    -&amp;gt;select($db-&amp;gt;quoteName(array(&#039;a.*&#039;, &#039;b.username&#039;, &#039;b.name&#039;, &#039;c.*&#039;, &#039;d.*&#039;)))&lt;br /&gt;
    -&amp;gt;from($db-&amp;gt;quoteName(&#039;#__content&#039;, &#039;a&#039;))&lt;br /&gt;
    -&amp;gt;join(&#039;INNER&#039;, $db-&amp;gt;quoteName(&#039;#__users&#039;, &#039;b&#039;) . &#039; ON (&#039; . $db-&amp;gt;quoteName(&#039;a.created_by&#039;) . &#039; = &#039; . $db-&amp;gt;quoteName(&#039;b.id&#039;) . &#039;)&#039;)&lt;br /&gt;
    -&amp;gt;join(&#039;LEFT&#039;, $db-&amp;gt;quoteName(&#039;#__user_profiles&#039;, &#039;c&#039;) . &#039; ON (&#039; . $db-&amp;gt;quoteName(&#039;b.id&#039;) . &#039; = &#039; . $db-&amp;gt;quoteName(&#039;c.user_id&#039;) . &#039;)&#039;)&lt;br /&gt;
    -&amp;gt;join(&#039;RIGHT&#039;, $db-&amp;gt;quoteName(&#039;#__categories&#039;, &#039;d&#039;) . &#039; ON (&#039; . $db-&amp;gt;quoteName(&#039;a.catid&#039;) . &#039; = &#039; . $db-&amp;gt;quoteName(&#039;d.id&#039;) . &#039;)&#039;)&lt;br /&gt;
    -&amp;gt;where($db-&amp;gt;quoteName(&#039;b.username&#039;) . &#039; LIKE \&#039;a%\&#039;&#039;)&lt;br /&gt;
    -&amp;gt;order($db-&amp;gt;quoteName(&#039;a.created&#039;) . &#039; DESC&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notice how chaining makes the source code much more readable for these longer queries.&lt;br /&gt;
&lt;br /&gt;
==Query Results ==&lt;br /&gt;
The database class contains many methods for working with a query&#039;s result set.&lt;br /&gt;
&lt;br /&gt;
=== Single Value Result ===&lt;br /&gt;
==== loadResult() ====&lt;br /&gt;
Use &#039;&#039;&#039;loadResult()&#039;&#039;&#039; when you expect just a single value back from your database query. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! id !! name !! email !! username&lt;br /&gt;
|- &lt;br /&gt;
| 1 || style=&amp;quot;background:yellow&amp;quot; | John Smith || johnsmith@domain.example || johnsmith&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Magda Hellman || magda_h@domain.example || magdah&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Yvonne de Gaulle || ydg@domain.example || ydegaulle&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This is often the result of a &#039;count&#039; query to get a number of records:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$db = JFactory::getDbo();&lt;br /&gt;
$query = $db-&amp;gt;getQuery(true);&lt;br /&gt;
$query-&amp;gt;select(&#039;COUNT(*)&#039;);&lt;br /&gt;
$query-&amp;gt;from($db-&amp;gt;quoteName&#039;#__my_table&#039;);&lt;br /&gt;
$query-&amp;gt;where($db-&amp;gt;quoteName(&#039;name&#039;).&amp;quot; = &amp;quot;.$db-&amp;gt;quote($value));&lt;br /&gt;
&lt;br /&gt;
// Reset the query using our newly populated query object.&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
$count = $db-&amp;gt;loadResult();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
or where you are just looking for a single field from a single row of the table (or possibly a single field from the first row returned).&lt;br /&gt;
&amp;lt;source lang=&#039;php&#039;&amp;gt;&lt;br /&gt;
$db = JFactory::getDbo();&lt;br /&gt;
$query = $db-&amp;gt;getQuery(true);&lt;br /&gt;
$query-&amp;gt;select(&#039;field_name&#039;);&lt;br /&gt;
$query-&amp;gt;from($db-&amp;gt;quoteName(&#039;#__my_table&#039;));&lt;br /&gt;
$query-&amp;gt;where($db-&amp;gt;quoteName(&#039;some_name&#039;).&amp;quot; = &amp;quot;.$db-&amp;gt;quote($some_value));&lt;br /&gt;
&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
$result = $db-&amp;gt;loadResult();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Single Row Results ===&lt;br /&gt;
Each of these results functions will return a single record from the database even though there may be several records that meet the criteria that you have set. To get more records you need to call the function again.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! id !! name !! email !! username&lt;br /&gt;
|- style=&amp;quot;background:yellow&amp;quot;&lt;br /&gt;
| 1 || John Smith || johnsmith@domain.example || johnsmith&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Magda Hellman || magda_h@domain.example || magdah&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Yvonne de Gaulle || ydg@domain.example || ydegaulle&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== loadRow() ====&lt;br /&gt;
loadRow() returns an indexed array from a single record in the table: &lt;br /&gt;
&amp;lt;source lang=&#039;php&#039;&amp;gt;&lt;br /&gt;
. . .&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
$row = $db-&amp;gt;loadRow();&lt;br /&gt;
print_r($row);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
will give:&lt;br /&gt;
&amp;lt;pre&amp;gt;Array ( [0] =&amp;gt; 1 [1] =&amp;gt; John Smith [2] =&amp;gt; johnsmith@domain.example [3] =&amp;gt; johnsmith ) &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can access the individual values by using:&amp;lt;pre&amp;gt;$row[&#039;index&#039;] // e.g. $row[&#039;2&#039;]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
# The array indices are numeric starting from zero.&lt;br /&gt;
# Whilst you can repeat the call to get further rows, one of the functions that returns multiple rows might be more useful.&lt;br /&gt;
&lt;br /&gt;
==== loadAssoc() ====&lt;br /&gt;
loadAssoc() returns an associated array from a single record in the table: &lt;br /&gt;
&amp;lt;source lang=&#039;php&#039;&amp;gt;&lt;br /&gt;
. . .&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
$row = $db-&amp;gt;loadAssoc();&lt;br /&gt;
print_r($row);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
will give:&lt;br /&gt;
&amp;lt;pre&amp;gt;Array ( [id] =&amp;gt; 1 [name] =&amp;gt; John Smith [email] =&amp;gt; johnsmith@domain.example [username] =&amp;gt; johnsmith )&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can access the individual values by using:&amp;lt;pre&amp;gt;$row[&#039;name&#039;] // e.g. $row[&#039;name&#039;]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
# Whilst you can repeat the call to get further rows, one of the functions that returns multiple rows might be more useful.&lt;br /&gt;
&lt;br /&gt;
==== loadObject() ====&lt;br /&gt;
loadObject returns a PHP object from a single record in the table: &lt;br /&gt;
&amp;lt;source lang=&#039;php&#039;&amp;gt;&lt;br /&gt;
. . .&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
$result = $db-&amp;gt;loadObject();&lt;br /&gt;
print_r($result);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
will give:&lt;br /&gt;
&amp;lt;pre&amp;gt;stdClass Object ( [id] =&amp;gt; 1 [name] =&amp;gt; John Smith [email] =&amp;gt; johnsmith@domain.example [username] =&amp;gt; johnsmith )&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can access the individual values by using:&amp;lt;pre&amp;gt;$result-&amp;gt;index // e.g. $result-&amp;gt;email&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
# Whilst you can repeat the call to get further rows, one of the functions that returns multiple rows might be more useful.&lt;br /&gt;
&lt;br /&gt;
===Single Column Results ===&lt;br /&gt;
Each of these results functions will return a single column from the database. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! id !! name !! email !! username&lt;br /&gt;
|- &lt;br /&gt;
| 1 || style=&amp;quot;background:yellow&amp;quot; | John Smith || johnsmith@domain.example || johnsmith&lt;br /&gt;
|-&lt;br /&gt;
| 2 || style=&amp;quot;background:yellow&amp;quot; | Magda Hellman || magda_h@domain.example || magdah&lt;br /&gt;
|-&lt;br /&gt;
| 3 || style=&amp;quot;background:yellow&amp;quot; | Yvonne de Gaulle || ydg@domain.example || ydegaulle&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== loadColumn() ====&lt;br /&gt;
loadColumn() returns an indexed array from a single column in the table: &lt;br /&gt;
&amp;lt;source lang=&#039;php&#039;&amp;gt;&lt;br /&gt;
$query-&amp;gt;select(&#039;name&#039;));&lt;br /&gt;
      -&amp;gt;from . . .&amp;quot;;&lt;br /&gt;
. . .&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
$column= $db-&amp;gt;loadColumn();&lt;br /&gt;
print_r($column);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
will give:&lt;br /&gt;
&amp;lt;pre&amp;gt;Array ( [0] =&amp;gt; John Smith [1] =&amp;gt; Magda Hellman [2] =&amp;gt; Yvonne de Gaulle )&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can access the individual values by using:&amp;lt;pre&amp;gt;$column[&#039;index&#039;] // e.g. $column[&#039;2&#039;]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
# The array indices are numeric starting from zero.&lt;br /&gt;
# loadColumn() is equivalent to loadColumn(0).&lt;br /&gt;
&lt;br /&gt;
==== loadColumn($index) ====&lt;br /&gt;
loadColumn($index) returns an indexed array from a single column in the table: &lt;br /&gt;
&amp;lt;source lang=&#039;php&#039;&amp;gt;&lt;br /&gt;
$query-&amp;gt;select(array(&#039;name&#039;, &#039;email&#039;, &#039;username&#039;));&lt;br /&gt;
      -&amp;gt;from . . .&amp;quot;;&lt;br /&gt;
. . .&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
$column= $db-&amp;gt;loadColumn(1);&lt;br /&gt;
print_r($column);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
will give:&lt;br /&gt;
&amp;lt;pre&amp;gt;Array ( [0] =&amp;gt; johnsmith@domain.example [1] =&amp;gt; magda_h@domain.example [2] =&amp;gt; ydg@domain.example )&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can access the individual values by using:&amp;lt;pre&amp;gt;$column[&#039;index&#039;] // e.g. $column[&#039;2&#039;]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
loadColumn($index) allows you to iterate through a series of columns in the results&lt;br /&gt;
&amp;lt;source lang=&#039;php&#039;&amp;gt;&lt;br /&gt;
. . .&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
for ( $i = 0; $i &amp;lt;= 2; $i++ ) {&lt;br /&gt;
  $column= $db-&amp;gt;loadColumn($i);&lt;br /&gt;
  print_r($column);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
will give:&lt;br /&gt;
&amp;lt;pre&amp;gt;Array ( [0] =&amp;gt; John Smith [1] =&amp;gt; Magda Hellman [2] =&amp;gt; Yvonne de Gaulle )&lt;br /&gt;
Array ( [0] =&amp;gt; johnsmith@domain.example [1] =&amp;gt; magda_h@domain.example [2] =&amp;gt; ydg@domain.example )&lt;br /&gt;
Array ( [0] =&amp;gt; johnsmith [1] =&amp;gt; magdah [2] =&amp;gt; ydegaulle )&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
# The array indices are numeric starting from zero.&lt;br /&gt;
&lt;br /&gt;
=== Multi-Row Results ===&lt;br /&gt;
Each of these results functions will return multiple records from the database. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! id !! name !! email !! username&lt;br /&gt;
|- style=&amp;quot;background:yellow&amp;quot;&lt;br /&gt;
| 1 || John Smith || johnsmith@domain.example || johnsmith&lt;br /&gt;
|- style=&amp;quot;background:yellow&amp;quot;&lt;br /&gt;
| 2 || Magda Hellman || magda_h@domain.example || magdah&lt;br /&gt;
|- style=&amp;quot;background:yellow&amp;quot;&lt;br /&gt;
| 3 || Yvonne de Gaulle || ydg@domain.example || ydegaulle&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== loadRowList() ====&lt;br /&gt;
loadRowList() returns an indexed array of indexed arrays from the table records returned by the query: &lt;br /&gt;
&amp;lt;source lang=&#039;php&#039;&amp;gt;&lt;br /&gt;
. . .&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
$row = $db-&amp;gt;loadRowList();&lt;br /&gt;
print_r($row);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
will give (with line breaks added for clarity):&lt;br /&gt;
&amp;lt;pre&amp;gt;Array ( &lt;br /&gt;
[0] =&amp;gt; Array ( [0] =&amp;gt; 1 [1] =&amp;gt; John Smith [2] =&amp;gt; johnsmith@domain.example [3] =&amp;gt; johnsmith ) &lt;br /&gt;
[1] =&amp;gt; Array ( [0] =&amp;gt; 2 [1] =&amp;gt; Magda Hellman [2] =&amp;gt; magda_h@domain.example [3] =&amp;gt; magdah ) &lt;br /&gt;
[2] =&amp;gt; Array ( [0] =&amp;gt; 3 [1] =&amp;gt; Yvonne de Gaulle [2] =&amp;gt; ydg@domain.example [3] =&amp;gt; ydegaulle ) &lt;br /&gt;
)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can access the individual rows by using:&amp;lt;pre&amp;gt;$row[&#039;index&#039;] // e.g. $row[&#039;2&#039;]&amp;lt;/pre&amp;gt;&lt;br /&gt;
and you can access the individual values by using:&amp;lt;pre&amp;gt;$row[&#039;index&#039;][&#039;index&#039;] // e.g. $row[&#039;2&#039;][&#039;3&#039;]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
# The array indices are numeric starting from zero.&lt;br /&gt;
&lt;br /&gt;
==== loadAssocList() ====&lt;br /&gt;
loadAssocList() returns an indexed array of associated arrays from the table records returned by the query: &lt;br /&gt;
&amp;lt;source lang=&#039;php&#039;&amp;gt;&lt;br /&gt;
. . .&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
$row = $db-&amp;gt;loadAssocList();&lt;br /&gt;
print_r($row);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
will give (with line breaks added for clarity):&lt;br /&gt;
&amp;lt;pre&amp;gt;Array ( &lt;br /&gt;
[0] =&amp;gt; Array ( [id] =&amp;gt; 1 [name] =&amp;gt; John Smith [email] =&amp;gt; johnsmith@domain.example [username] =&amp;gt; johnsmith ) &lt;br /&gt;
[1] =&amp;gt; Array ( [id] =&amp;gt; 2 [name] =&amp;gt; Magda Hellman [email] =&amp;gt; magda_h@domain.example [username] =&amp;gt; magdah ) &lt;br /&gt;
[2] =&amp;gt; Array ( [id] =&amp;gt; 3 [name] =&amp;gt; Yvonne de Gaulle [email] =&amp;gt; ydg@domain.example [username] =&amp;gt; ydegaulle ) &lt;br /&gt;
) &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can access the individual rows by using:&amp;lt;pre&amp;gt;$row[&#039;index&#039;] // e.g. $row[&#039;2&#039;]&amp;lt;/pre&amp;gt;&lt;br /&gt;
and you can access the individual values by using:&amp;lt;pre&amp;gt;$row[&#039;index&#039;][&#039;column_name&#039;] // e.g. $row[&#039;2&#039;][&#039;email&#039;]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== loadAssocList($key) ====&lt;br /&gt;
loadAssocList(&#039;key&#039;) returns an associated array - indexed on &#039;key&#039; - of associated arrays from the table records returned by the query: &lt;br /&gt;
&amp;lt;source lang=&#039;php&#039;&amp;gt;&lt;br /&gt;
. . .&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
$row = $db-&amp;gt;loadAssocList(&#039;username&#039;);&lt;br /&gt;
print_r($row);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
will give (with line breaks added for clarity):&lt;br /&gt;
&amp;lt;pre&amp;gt;Array ( &lt;br /&gt;
[johnsmith] =&amp;gt; Array ( [id] =&amp;gt; 1 [name] =&amp;gt; John Smith [email] =&amp;gt; johnsmith@domain.example [username] =&amp;gt; johnsmith ) &lt;br /&gt;
[magdah] =&amp;gt; Array ( [id] =&amp;gt; 2 [name] =&amp;gt; Magda Hellman [email] =&amp;gt; magda_h@domain.example [username] =&amp;gt; magdah ) &lt;br /&gt;
[ydegaulle] =&amp;gt; Array ( [id] =&amp;gt; 3 [name] =&amp;gt; Yvonne de Gaulle [email] =&amp;gt; ydg@domain.example [username] =&amp;gt; ydegaulle ) &lt;br /&gt;
)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can access the individual rows by using:&amp;lt;pre&amp;gt;$row[&#039;key_value&#039;] // e.g. $row[&#039;johnsmith&#039;]&amp;lt;/pre&amp;gt;&lt;br /&gt;
and you can access the individual values by using:&amp;lt;pre&amp;gt;$row[&#039;key_value&#039;][&#039;column_name&#039;] // e.g. $row[&#039;johnsmith&#039;][&#039;email&#039;]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: Key must be a valid column name from the table; it does not have to be an Index or a Primary Key. But if it does not have a unique value you may not be able to retrieve results reliably.&lt;br /&gt;
&lt;br /&gt;
==== loadObjectList() ====&lt;br /&gt;
loadObjectList() returns an indexed array of PHP objects from the table records returned by the query: &lt;br /&gt;
&amp;lt;source lang=&#039;php&#039;&amp;gt;&lt;br /&gt;
. . .&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
$row = $db-&amp;gt;loadObjectList();&lt;br /&gt;
print_r($row);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
will give (with line breaks added for clarity):&lt;br /&gt;
&amp;lt;pre&amp;gt;Array ( &lt;br /&gt;
[0] =&amp;gt; stdClass Object ( [id] =&amp;gt; 1 [name] =&amp;gt; John Smith &lt;br /&gt;
    [email] =&amp;gt; johnsmith@domain.example [username] =&amp;gt; johnsmith ) &lt;br /&gt;
[1] =&amp;gt; stdClass Object ( [id] =&amp;gt; 2 [name] =&amp;gt; Magda Hellman &lt;br /&gt;
    [email] =&amp;gt; magda_h@domain.example [username] =&amp;gt; magdah ) &lt;br /&gt;
[2] =&amp;gt; stdClass Object ( [id] =&amp;gt; 3 [name] =&amp;gt; Yvonne de Gaulle &lt;br /&gt;
    [email] =&amp;gt; ydg@domain.example [username] =&amp;gt; ydegaulle ) &lt;br /&gt;
)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can access the individual rows by using:&amp;lt;pre&amp;gt;$row[&#039;index&#039;] // e.g. $row[&#039;2&#039;]&amp;lt;/pre&amp;gt;&lt;br /&gt;
and you can access the individual values by using:&amp;lt;pre&amp;gt;$row[&#039;index&#039;]-&amp;gt;name // e.g. $row[&#039;2&#039;]-&amp;gt;email&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== loadObjectList(&#039;key&#039;) ====&lt;br /&gt;
loadObjectList($key) returns an associated array - indexed on &#039;key&#039; - of objects from the table records returned by the query: &lt;br /&gt;
&amp;lt;source lang=&#039;php&#039;&amp;gt;&lt;br /&gt;
. . .&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
$row = $db-&amp;gt;loadObjectList(&#039;username&#039;);&lt;br /&gt;
print_r($row);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
will give (with line breaks added for clarity):&lt;br /&gt;
&amp;lt;pre&amp;gt;Array ( &lt;br /&gt;
[johnsmith] =&amp;gt; stdClass Object ( [id] =&amp;gt; 1 [name] =&amp;gt; John Smith &lt;br /&gt;
    [email] =&amp;gt; johnsmith@domain.example [username] =&amp;gt; johnsmith ) &lt;br /&gt;
[magdah] =&amp;gt; stdClass Object ( [id] =&amp;gt; 2 [name] =&amp;gt; Magda Hellman &lt;br /&gt;
    [email] =&amp;gt; magda_h@domain.example [username] =&amp;gt; magdah ) &lt;br /&gt;
[ydegaulle] =&amp;gt; stdClass Object ( [id] =&amp;gt; 3 [name] =&amp;gt; Yvonne de Gaulle &lt;br /&gt;
    [email] =&amp;gt; ydg@domain.example [username] =&amp;gt; ydegaulle ) &lt;br /&gt;
)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can access the individual rows by using:&amp;lt;pre&amp;gt;$row[&#039;key_value&#039;] // e.g. $row[&#039;johnsmith&#039;]&amp;lt;/pre&amp;gt;&lt;br /&gt;
and you can access the individual values by using:&amp;lt;pre&amp;gt;$row[&#039;key_value&#039;]-&amp;gt;column_name // e.g. $row[&#039;johnsmith&#039;]-&amp;gt;email&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: Key must be a valid column name from the table; it does not have to be an Index or a Primary Key. But if it does not have a unique value you may not be able to retrieve results reliably.&lt;br /&gt;
&lt;br /&gt;
=== Miscellaneous Result Set Methods ===&lt;br /&gt;
==== getNumRows() ====&lt;br /&gt;
getNumRows() will return the number of result rows found by the last query and waiting to be read. To get a result from getNumRows() you have to run it &#039;&#039;&#039;after&#039;&#039;&#039; the query and &#039;&#039;&#039;before&#039;&#039;&#039; you have retrieved any results.  &lt;br /&gt;
&amp;lt;source lang=&#039;php&#039;&amp;gt;&lt;br /&gt;
. . .&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
$db-&amp;gt;execute();&lt;br /&gt;
$num_rows = $db-&amp;gt;getNumRows();&lt;br /&gt;
print_r($num_rows);&lt;br /&gt;
$result = $db-&amp;gt;loadRowList();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
will return &amp;lt;pre&amp;gt;3&amp;lt;/pre&amp;gt;&lt;br /&gt;
Note: if you run getNumRows() after loadRowList() - or any other retrieval method - you may get a PHP Warning:&lt;br /&gt;
&amp;lt;pre&amp;gt;Warning: mysql_num_rows(): 80 is not a valid MySQL result resource &lt;br /&gt;
in libraries\joomla\database\database\mysql.php on line 344&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Extension development]]&lt;br /&gt;
[[Category:Database]]&lt;br /&gt;
[[Category:JFactory]]&lt;/div&gt;</summary>
		<author><name>Bobbravo2</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J1.5_talk:Developing_a_MVC_Component/Creating_an_Administrator_Interface&amp;diff=17842</id>
		<title>J1.5 talk:Developing a MVC Component/Creating an Administrator Interface</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J1.5_talk:Developing_a_MVC_Component/Creating_an_Administrator_Interface&amp;diff=17842"/>
		<updated>2009-11-20T19:11:17Z</updated>

		<summary type="html">&lt;p&gt;Bobbravo2: fixing link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Renaming Part 4 ==&lt;br /&gt;
I checked out the comment below. ;-) Certainly, the multitude of hello(s) is confusing. What I did is to rename most everything.&lt;br /&gt;
&lt;br /&gt;
Whenever there&#039;s something like HelloWhateverHello, the first Hello represents the component front-end, and the second represents the view/model. By the way, each view has its own model, which I think is pretty much standard MVC architecture. On the other hand, one controller can control several views, although this example doesn&#039;t do so.&lt;br /&gt;
&lt;br /&gt;
Conversely, if you see HellosWhateverHello or HellosWhateverHellos, the first Hellos represents the adminstrative back-end, and the Hello or Hellos at the end refers to the view for editing one greeting or for listing all greetings, respectively. (Replace *Whatever* with Model, View, or Controller as appropriate.)&lt;br /&gt;
&lt;br /&gt;
So, I renamed all this to look like FrontWhateverContent, AdminWhateverEdit, AdminWhateverList, and so on. Then I had to rename directories and files as well, so that models/hello.php became models/content.php in the front-end and models/edit.php in the back-end. Likewise, views/hello/ becomes views/content/ in the front-end and views/edit in the back-end. Also, in the back-end only, models/hellos.php &amp;amp; views/hellos/ become models/list.php &amp;amp; views/list. Lastly, I changed controllers/hello.php to controllers/edit.php, to reflect the change from HellosControllerHello to AdminControllerEdit.&lt;br /&gt;
&lt;br /&gt;
Hope this clears things up a bit. It&#039;s a tedious refactoring exercise to do all this renaming, but it *is* doable. Good luck.&lt;br /&gt;
&lt;br /&gt;
== &amp;quot;Hello&amp;quot; Overloaded ==&lt;br /&gt;
&lt;br /&gt;
I&#039;m not sure if anybody checks this, but I&#039;m having a difficult time making my own component out of this document. &lt;br /&gt;
&lt;br /&gt;
The first three chapters of this documentation are great.  They are simple and to the point.  The fourth, this page, is very confusing.  &lt;br /&gt;
&lt;br /&gt;
First off, the word &amp;quot;hello&amp;quot; is way over loaded.  In the Creating an Admin Interface there are two models and two views:&lt;br /&gt;
Hello  and Hellos&lt;br /&gt;
&lt;br /&gt;
It&#039;s impossible to know why we need two different models.  Why cant we use one model and two views?&lt;br /&gt;
Its totally impossible to understand which one gets called when.&lt;br /&gt;
&lt;br /&gt;
I have discovered there are a lot of name conventions used here, but after reading this document over and over, it&#039;s still very difficult to know what the conventions are.  This is probably stemming from &amp;quot;hello&amp;quot; being way too overloaded.&lt;br /&gt;
&lt;br /&gt;
The method &amp;quot;get()&amp;quot; in JView is called in both views.  It is supposed to automatically know which model to use, and which method to call.  However, I don&#039;t think I followed the naming convention correctly, as it simply is not working (I get empty data with no error).&lt;br /&gt;
&lt;br /&gt;
I think I could untangle the naming conventions myself, but with &amp;quot;hello&amp;quot; so overloaded in this example, I am having no luck guessing.&lt;br /&gt;
&lt;br /&gt;
== Great up to chapter 3 ==&lt;br /&gt;
&lt;br /&gt;
The documentation was great upto chapter 3.  Got confused in 4th chapter.&lt;br /&gt;
&lt;br /&gt;
Also, this doesn&#039;t cover how to create sub menus for a component [http://www.vojtechovsky.net/joomla/component/tutorial-joomla-1.5-free-component.png See example]&lt;br /&gt;
&lt;br /&gt;
== Suggestions for improvement ==&lt;br /&gt;
&lt;br /&gt;
*This is a really long and tedious tutorial with a lot of very useful information in it. I think it would help to break it down into parts or creating separate tutorials covering this material.&lt;br /&gt;
[[Link title]]&lt;br /&gt;
&lt;br /&gt;
== REALLY GOOD DOCUMENTATION ==&lt;br /&gt;
&lt;br /&gt;
Apart from a small error in part 4 which I have now corrected&lt;br /&gt;
&lt;br /&gt;
did read: &lt;br /&gt;
&lt;br /&gt;
        $row =&amp;amp; $this-&amp;gt;items[$i];&lt;br /&gt;
        $checked    = JHTML::_( &#039;grid.id&#039;, $i, $row-&amp;gt;id );&lt;br /&gt;
        $link = JRoute::_( &#039;index.php?option=com_hello&amp;gt;controller=hello&amp;gt;task=edit&amp;gt;cid[]=&#039;. $row-&amp;gt;id );&lt;br /&gt;
&lt;br /&gt;
now reads:&lt;br /&gt;
&lt;br /&gt;
        $row =&amp;amp; $this-&amp;gt;items[$i];&lt;br /&gt;
        $checked    = JHTML::_( &#039;grid.id&#039;, $i, $row-&amp;gt;id );&lt;br /&gt;
        $link = JRoute::_( &#039;index.php?option=com_hello&amp;amp;controller=hello&amp;amp;task=edit&amp;amp;cid[]=&#039;. $row-&amp;gt;id );&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[User:Jamesconroyuk|James Conroy]] 16:29, 16 February 2009 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Excellent documentation, but could use a slight extension ==&lt;br /&gt;
&lt;br /&gt;
Have been able to create components using this set of tutorials, but am missing how to use non-string based data in the administrator interface.&lt;br /&gt;
&lt;br /&gt;
The admin form only has one field (a string) and it might be useful to have either examples of, or a link to some other examples of how to view / capture other types of data such as :&lt;br /&gt;
&lt;br /&gt;
Checkboxes (boolean)&lt;br /&gt;
Dropdown menus / radio button (int or string)&lt;br /&gt;
&lt;br /&gt;
While it is easy to add the HTML form components (and even populate them with the values from the model), it isn&#039;t immediately clear how to recapture the data of these alternative types.&lt;br /&gt;
&lt;br /&gt;
There is another tutorial I have seen on this wiki that has the &amp;quot;build in a rich editor&amp;quot; function, could use a link from this page.&lt;br /&gt;
&lt;br /&gt;
[[User:craigmoore|Craig Moore]] 13:06, 09 May 2009 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Really a great tutorial ... but too many hello.php&#039;s ==&lt;br /&gt;
&lt;br /&gt;
First of all, great tutorial, a very good effort to explain the basics.&lt;br /&gt;
&lt;br /&gt;
Maybe just my problem:&lt;br /&gt;
I personally prefer to edit several files at a time, what means, i have 10-20 tabs open in my editor (UltraEdit).&lt;br /&gt;
In my case that means, that my editor tab-bar looks like:&lt;br /&gt;
&lt;br /&gt;
hello.php - controller.php - hello.php - hello.php - hello.php - controller.php - hellos.php - and so on ...&lt;br /&gt;
&lt;br /&gt;
I would kiss the shoes of everyone who would:&lt;br /&gt;
&lt;br /&gt;
1.) precisely explain naming conventions for files of components (which file may, which file must be called hello.php)&lt;br /&gt;
&lt;br /&gt;
2.) resolve the hello.php-maze in this tutorial with more speaking filenames&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Thanks to the authors, best regards and a hello to everyone&lt;br /&gt;
&lt;br /&gt;
Jochen&lt;br /&gt;
&lt;br /&gt;
== Good Tutorial ==&lt;br /&gt;
&lt;br /&gt;
Suggestion for improvement.&lt;br /&gt;
&lt;br /&gt;
I also found Part 4 hard to follow and lacking explanation of why various names/paths/parameters were chosen. For a beginner trying to understand Joomla! MVC conventions I found another component backend howto that gave more of the details I was looking for: [http://www.scribd.com/doc/11515210/Joomla-Component-Development-Backend]&lt;br /&gt;
&lt;br /&gt;
Hope this helps someone else.&lt;br /&gt;
-Mike&lt;br /&gt;
[[User:M3t00|M3t00]] 15:55, 10 June 2009 (UTC)&lt;br /&gt;
&lt;br /&gt;
== RE: Renaming Part 4 ==&lt;br /&gt;
&lt;br /&gt;
I&#039;m actually even more confused now.&lt;br /&gt;
&lt;br /&gt;
Only by reading through this discussion did it occur to me that you need to use multiple views to handle the various tasks in the controller.  That seems like an important concept that is not entirely obvious to someone trying to learn the joomla framework.  And yet now that I recognize the concept, it&#039;s not obvious what the best practices would be to implement multiple views.  I&#039;ll work on it.&lt;br /&gt;
&lt;br /&gt;
Despite that, this is still an extremely valuable tutorial -- especially considering that much of the rest of the API documentation is sparse at best.  The entire joomla documentation in general could definitely benefit from a bit of a re-org.&lt;br /&gt;
&lt;br /&gt;
EDIT:  OK. So after reading through part 4 of the tutorial again, it is clear to me about the multiple views.  So, looking back, it would have been valuable to explain that in the introduction.  Something like:&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Now we will create an administrator section to create the greetings.  It uses 2 views.  The first view, called Hellos, will present a list of greetings with the ability to add new ones or remove old ones.  The second view will allow the user to edit each greeting.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
That would have helped tremendously.  In any case, I got it now.  I feel a little stupid for missing that the first time around, but maybe it was because it was late at night.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Component Hello, Site Hello, Admin Hellos, Admin Hello ==&lt;br /&gt;
&lt;br /&gt;
Chapters 1 and 2 were easy to follow. Chapter 3 contains some glitches that took me some time to understand but reading this chapter made everything really confusing. It took me a time to realise the Hello&#039;s, just my subject with only the focus clarifies already some impact. After re- and re-re reading it becomes clear to me what is meant. After re-reading the reason for using Hellos (as an Admin List) became clear and re-re- reading made the Admin single view/tmpl Hello obvious again. Why not rename these to:&lt;br /&gt;
&lt;br /&gt;
* Manage_Hello_List&lt;br /&gt;
* Manage_Hello_Item&lt;br /&gt;
&lt;br /&gt;
This would make everything much more readable, would set a clear context and increase the ease of understanding.&amp;lt;br&amp;gt;&lt;br /&gt;
--[[User:M.A.S.H|M.A.S.H]] 12:37, 3 August 2009 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Splitting up article into two articles ==&lt;br /&gt;
&lt;br /&gt;
If the writers have no objection I propose to split this chapter into two. There are multiple good reasons for doing so but the most important three are the following:&lt;br /&gt;
*This chapter is huge making reading a tedious job, overwhelming and scaring away the once that this article is intended for.&lt;br /&gt;
*This article has two logical section so braking it at &#039;&#039;&#039;Adding Functionality&#039;&#039;&#039; doesn&#039;t harm any body and helps newbies in achieving results. Being able to check a chapter and visually see the intermediate result is always the best motivation.&lt;br /&gt;
*Technically the same split at &#039;&#039;&#039;Adding Functionality&#039;&#039;&#039; is making a difference in know-how. the first part is not really new when you followed the &#039;&#039;site&#039;&#039; part examples &#039;&#039;&#039;Developing a Model-View-Controller Component 1, 2 and 3&#039;&#039;&#039;. Old wine in new bottles. The second part really goes into depth and requires good basic programming skills and a general understanding of HTML form handling.&lt;br /&gt;
If no objections I will initiate this spilt soon.&amp;lt;br&amp;gt;&lt;br /&gt;
--[[User:M.A.S.H|M.A.S.H]] 07:34, 10 August 2009 (UTC)&lt;br /&gt;
&lt;br /&gt;
I think splitting it is a good idea and should improve readability.  I look forward to seeing your improvements. [[User:Chris Davenport|Chris Davenport]] 08:51, 10 August 2009 (UTC)&lt;/div&gt;</summary>
		<author><name>Bobbravo2</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Talk:Setting_up_your_workstation_for_extension_development_(build_with_Phing)&amp;diff=13263</id>
		<title>Talk:Setting up your workstation for extension development (build with Phing)</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Talk:Setting_up_your_workstation_for_extension_development_(build_with_Phing)&amp;diff=13263"/>
		<updated>2009-02-21T02:45:08Z</updated>

		<summary type="html">&lt;p&gt;Bobbravo2: New page: this article fails to explain the content of the original package before it is installed, way before setting up PHING needs improvement&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;this article fails to explain the content of the original package before it is installed, way before setting up PHING needs improvement&lt;/div&gt;</summary>
		<author><name>Bobbravo2</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Portal:Developers&amp;diff=13201</id>
		<title>Portal:Developers</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Portal:Developers&amp;diff=13201"/>
		<updated>2009-02-13T21:05:35Z</updated>

		<summary type="html">&lt;p&gt;Bobbravo2: /* General */ added link to extension development&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Developer profile}}&lt;br /&gt;
&lt;br /&gt;
A complete contents list of all pages of interest to developers can be found in the [[:Category:Development|development category]].&lt;br /&gt;
&lt;br /&gt;
== Reference Material ==&lt;br /&gt;
&lt;br /&gt;
* [[Framework|Joomla Framework]].&lt;br /&gt;
* [http://api.joomla.org API documentation] automatically generated using phpDocumentor.&lt;br /&gt;
&lt;br /&gt;
== Articles and Tutorials ==&lt;br /&gt;
&lt;br /&gt;
=== General ===&lt;br /&gt;
* [[Setting up your workstation for Joomla! development]].  A step-by-step guide to installing the Eclipse IDE on your local workstation for Joomla! development.&lt;br /&gt;
* [[Setting up your workstation for extension development]] A guide to Joomla Extension development&lt;br /&gt;
* [[Do not use die to debug]]&lt;br /&gt;
* [[How to debug your code]]&lt;br /&gt;
* [[Tutorial:Adapting Joomla 1.0 extensions to Joomla 1.5]]&lt;br /&gt;
* [[Version 1.6 Developer Notes]]&lt;br /&gt;
&lt;br /&gt;
=== Components ===&lt;br /&gt;
* [[Developing a Model-View-Controller Component - Part 1]]&lt;br /&gt;
* [[Developing a Model-View-Controller Component - Part 2 - Adding a Model]]&lt;br /&gt;
* [[Developing a Model-View-Controller Component - Part 3 - Using the Database]]&lt;br /&gt;
* [[Developing a Model-View-Controller Component - Part 4 - Creating an Administrator Interface]]&lt;br /&gt;
* [[Component parameters]]&lt;br /&gt;
* [[Components:xml installfile]].  An example component XML installation file.&lt;br /&gt;
* [[How to use the JPane classes in a component]]&lt;br /&gt;
* [[How to use the editor in a component]]&lt;br /&gt;
* [[Supporting plugins in your component]]&lt;br /&gt;
* [[Tutorial:Adding Javascript moo.fx to your component WIP]]&lt;br /&gt;
&lt;br /&gt;
=== Modules ===&lt;br /&gt;
* [[Tutorial:Creating a Hello World Module for Joomla_1.5]]&lt;br /&gt;
* [[How to create a module]]&lt;br /&gt;
&lt;br /&gt;
=== Plugins ===&lt;br /&gt;
* [[Plugin Developer Overview]]&lt;br /&gt;
* [[Tutorial:Plugins]]&lt;br /&gt;
* [http://developer.joomla.org/tutorials/184-how-to-create-a-joomla-plugin.html How to create a Joomla! Plugin]&lt;br /&gt;
* [[How to create a content plugin]]&lt;br /&gt;
* [[How to create a search plugin]]&lt;br /&gt;
* [[Supporting plugins in your component]]&lt;br /&gt;
* [[Tutorial:Creating an Authentication Plugin for Joomla 1.5]]&lt;br /&gt;
* [[Tutorial:Using plugins in your own extension]]&lt;br /&gt;
&lt;br /&gt;
=== Templates ===&lt;br /&gt;
* [[Understanding Output Overrides]]&lt;br /&gt;
* [http://developer.joomla.org/tutorials/165-understanding-output-overrides-in-joomla.html Understanding Output Overrides in Joomla! 1.5]&lt;br /&gt;
* [[Creating custom template parameter types]]&lt;br /&gt;
* [[How are templates executed?]]&lt;br /&gt;
* [[How to determine if the user is viewing the front page]]&lt;br /&gt;
* [[Tutorial:Template parameters]]&lt;br /&gt;
&lt;br /&gt;
=== Security ===&lt;br /&gt;
* [[How to add CSRF anti-spoofing to forms]]&lt;br /&gt;
* [http://developer.joomla.org/tutorials/181-preventing-sql-injections.html Preventing SQL Injections]&lt;br /&gt;
&lt;br /&gt;
=== Database ===&lt;br /&gt;
* [[How to use the database classes in your script]]&lt;br /&gt;
* [[How to use the JTable class]]&lt;br /&gt;
* [[How to connect to an external database]]&lt;br /&gt;
&lt;br /&gt;
=== Localisation ===&lt;br /&gt;
* [http://community.joomla.org/magazine/article/508-developer-localization-advancements-in-joomla-15.html Localization Advancements in Joomla! 1.5]&lt;br /&gt;
* [[Adding multi-language support]]&lt;br /&gt;
&lt;br /&gt;
=== Miscellaneous ===&lt;br /&gt;
* [[How to use the filesystem package]]&lt;br /&gt;
* [[How to use the editor in a component]]&lt;br /&gt;
* [[Adding AJAX to your component]].&lt;br /&gt;
* [[How to send email from components]]&lt;br /&gt;
* [[How to use the JToolBar class in the frontend]]&lt;br /&gt;
* [[Routing]]&lt;br /&gt;
* [[Joomla Routes and SEF]]&lt;br /&gt;
* [[API Execution Order]]&lt;br /&gt;
* [[Accessing the current user object]]&lt;br /&gt;
* [[Adding JavaScript and CSS to the page]]&lt;br /&gt;
* [[Standard parameter types]]&lt;br /&gt;
* [[Constants]] used in the Joomla [[Framework]].&lt;br /&gt;
* [[Form validation]]&lt;br /&gt;
* [[How to create a custom button]]&lt;br /&gt;
* [[How to create a stand-alone application using the Joomla! Framework]]&lt;br /&gt;
* [[How to use user state variables]]&lt;br /&gt;
* [[Retrieving data from GET and POST requests]]&lt;br /&gt;
* [[Tutorial:Using Caching to Speed Up Your Code]]&lt;br /&gt;
* [[Using caching to speed up your code]]&lt;br /&gt;
* [[Using JPagination in your component]]&lt;br /&gt;
* [[Using a custom image in the menu bar title]]&lt;br /&gt;
* [[Using the installer API to support package installation]]&lt;br /&gt;
* [[Tutorial:How to add tooltips to your Joomla! website]]&lt;br /&gt;
&lt;br /&gt;
== Contributing to Joomla Development ==&lt;br /&gt;
The development of Joomla itself is carried out by the [[Development Working Group]] and third party developers.&lt;br /&gt;
&lt;br /&gt;
* [[Participating in the community]]: a brief description of how people can get involved.&lt;br /&gt;
* [[Developer Email lists]]: a list of email lists for developers, including third party developers.&lt;br /&gt;
* [[Coding style and standards]] (To be reviewed).&lt;br /&gt;
* [[Patch submission guidelines]].&lt;br /&gt;
* [[Filing bugs and issues]].&lt;br /&gt;
* [[How to release a distribution tarball]].&lt;br /&gt;
&lt;br /&gt;
== Contributing to Joomla Developer Documentation ==&lt;br /&gt;
The development of Joomla developer documentation is carried out primarily by the [[Documentation Working Group]].  There are currently two sub-projects of interest to developers:&lt;br /&gt;
* [[Joomla! 1.5 Template Tutorials Project]]&lt;br /&gt;
* [[API Reference Project]]&lt;br /&gt;
&lt;br /&gt;
When creating a new page, ensure you place the following marker at the bottom of the page so it is included in the category list:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;[[Category:Development]]&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you locate other articles you think are relevant to developers, please add this marker to those pages.&lt;br /&gt;
&lt;br /&gt;
=== Suggested topics ===&lt;br /&gt;
This is a short list of articles that might be written to support developers.  Please feel free to add further topic ideas.&lt;br /&gt;
&lt;br /&gt;
* [[Creating a toolbar for your component]].&lt;br /&gt;
* [[Adding configuration objects to modules and plugins]].&lt;br /&gt;
* [[Storing data in the session between page loads]].&lt;br /&gt;
* [[Using the caching system in your component]].&lt;br /&gt;
* [[Creating a file uploader in your component]].&lt;br /&gt;
* [[Suppressing output of extra HTML]].&lt;br /&gt;
* [[Adding view layout configuration parameters]].&lt;br /&gt;
*: Explain how to create an XML file that will allow users to configure views.&lt;br /&gt;
* [[How to implement XML-RPC in a component]].&lt;br /&gt;
*: There are two ways to do this:&lt;br /&gt;
*:* Implement it using an XML-RPC plugin or&lt;br /&gt;
*:* Implement it in the component itself using raw views&lt;br /&gt;
* [[How to use the filter package]].&lt;br /&gt;
*: Describe how and when to use the Filter package and explain what needs to be filtered for various situations (for queries, for URLs, etc)&lt;br /&gt;
* [[How to use the registry package]]&lt;br /&gt;
* [[How to use JSimpleXML]].&lt;br /&gt;
*: How to load and store XML files and how to work with them&lt;br /&gt;
* [[How to add breadcrumbs]]&lt;br /&gt;
* [[How to create component feeds]] (RSS/ATOM)&lt;br /&gt;
* [[How to create PDF views]]&lt;br /&gt;
* [[How to generate paths for client side and server side]]&lt;br /&gt;
* [[How to access information from the request]]&lt;br /&gt;
*: This focuses on using the JBrowser class to retrieve information about the features available in the user&#039;s browser.&lt;br /&gt;
* [[How to create an editor plugin]]&lt;br /&gt;
* [[What can be done with a user plugin]]&lt;br /&gt;
* [[How to work with parameters]]&lt;br /&gt;
* [[How to cloak email addresses]]&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Bobbravo2</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Archived:Learn_more_about_patch_files&amp;diff=13192</id>
		<title>Archived:Learn more about patch files</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Archived:Learn_more_about_patch_files&amp;diff=13192"/>
		<updated>2009-02-13T02:04:50Z</updated>

		<summary type="html">&lt;p&gt;Bobbravo2: typo corrections&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Bug Squad]]&lt;br /&gt;
&lt;br /&gt;
Test this patch, make a patch, are things you hear when you report an issue or when you&#039;re working on bugs. What exactly is a patch?&lt;br /&gt;
&lt;br /&gt;
A patch is a file that indicates which exact lines in which exact files should be changed.&lt;br /&gt;
&lt;br /&gt;
Here&#039;s a recent patch from issue 11354 which corrected a simple typo.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 Index: plugins/authentication/gmail.php&lt;br /&gt;
 ===================================================================&lt;br /&gt;
 --- plugins/authentication/gmail.php (revision 10386)&lt;br /&gt;
 +++ plugins/authentication/gmail.php (working copy)&lt;br /&gt;
 @@ -87,7 +87,7 @@&lt;br /&gt;
  }&lt;br /&gt;
  }&lt;br /&gt;
  else {&lt;br /&gt;
 - $message = &#039;curl isn\&#039;t insalled&#039;;&lt;br /&gt;
 + $message = &#039;curl isn\&#039;t installed&#039;;&lt;br /&gt;
  } &lt;br /&gt;
  if ($success)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Looking more closely, we see that the patch always starts with the name of the changed file relative to the Joomla! root. In this case it is the file gmail.php in the plugins/authenticaion folder.&lt;br /&gt;
&lt;br /&gt;
Next we see the file named again in two lines. The number in the first line represents the version of the code base or build on which the patch was created, The working copy is the copy that is changed. What do I mean by build? Every time a change is made to the codebase, that creates a new revision or build. You can find your build number in the changelog.php file in your joomla! root.&lt;br /&gt;
&lt;br /&gt;
Next comes @@ -87,7 +87,7 @@ which tells us that the change will start on line 87 of the file.&lt;br /&gt;
&lt;br /&gt;
Finally we see the code. The old line 87 has a – in front of it and the new line 87 has a +.&lt;br /&gt;
&lt;br /&gt;
The new version of the line will replace the old line in the file.&lt;br /&gt;
&lt;br /&gt;
Of course most patches are much more complex than this, but they really just are repeated instances of this structure.&lt;br /&gt;
&lt;br /&gt;
So if you saw this patch file and wanted to fix your version of Joomla! all you would need to do is find line 87 of gmail.php and make that change. So if someone tells you “There&#039;s a patch on the tracker” what they are saying is that you can go download the patch and apply it to your version of Joomla!. However one thing to keep in mind is that if your version does not match the version in the code repository it is possible that that patch will not work because it depends on or impacts other parts of the code.&lt;br /&gt;
&lt;br /&gt;
Now, if you&#039;re contributing a bug fix  as opposed to just reporting an issue, the ideal is to submit a patch file that you have tested. However, if you can&#039;t do that, at least give this information:&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
    * The complete names and paths of any files changed&lt;br /&gt;
    * The line numbers of the changes&lt;br /&gt;
    * The old and new versions of the changed lines&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
However, making a patch file is even better and  is not complicated if you install a subversion client such as Tortoise or the Subclipse plugin for Eclipse. For information on how to install the Eclipse IDE, see [[Setting_up_your_workstation_for_Joomla!_development | Setting up your workstation for Joomla! development]].&lt;/div&gt;</summary>
		<author><name>Bobbravo2</name></author>
	</entry>
</feed>