Setting up the database
We need to create a table in our Joomla! database to store the data for this component. Your local development environment should include phpMyAdmin which allows you to access the database directly. If you are using XAMPP, the URL will be http://localhost/phpmyadmin
.
Select your database.
On the SQL tab, paste in the following, making sure that you change the
jos_ prefix
to suit your database:CREATE TABLE IF NOT EXISTS `jos_folio` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `title` varchar(250) NOT NULL DEFAULT '', `alias` varchar(255) NOT NULL DEFAULT '', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
Press the GO button.
For now we are just creating three fields, an id
field that contains a unique reference number for that record, the title
field, and an alias
field.
When we distribute our component to other people, we don't want them to have to manually add the table into their own database, so we can create an install SQL...