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.

  1. Select your database.
  2. 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 ;
  3. Press the GO button.

For now we are just creating three fields, an id field that contains ...

Get Learning Joomla! 3 Extension Development - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.