How Joomla! helps us work with the database
At this point we can start thinking about the database. Without that our component wouldn't be of much use. As you will see, Joomla!'s database class will be more helpful this time. For now, we are going to create the table that we are going to use. The query is as follows:
CREATE TABLE `jos_tinynews` ( `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY , `title` VARCHAR( 255 ) NOT NULL , `text` TEXT NOT NULL `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY , `title` VARCHAR( 255 ) NOT NULL , `text` TEXT NOT NULL )
As we can see, we have placed the prefix jos_
to our
tinynews
table name. That's the prefix that we usually use, but if
you are using another prefix, place it there. Once we have the table created, we can
start experimenting with it. The other two fields are title
and text
. Later we will be adding some more fields, but these
will be...