Book Image

concrete5 Beginner's Guide

Book Image

concrete5 Beginner's Guide

Overview of this book

Table of Contents (19 chapters)
concrete5
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Time for action – creating the database structure


Carry out the following steps:

  1. In our block directory, create a new file named db.xml; that's everything we'll need.

  2. In this file, you have to add a hierarchical structure of tables and columns. The whole content of the file should look like the following:

    <?xml version="1.0"?>
    <schema version="0.3">
       <table name="btProductInformation">
          <field name="bID" type="I">
             <key />
             <unsigned />
          </field>
          <field name="title" type="C" size="255"></field>      
          <field name="description" type="X2"></field>
          <field name="fIDpicture" type="I"></field>
       </table>
    </schema>

What just happened?

The file we created is everything we'll need to tell concrete5 what to create in the database for our add-on. Most of it should be pretty intuitive; it starts with the obvious XML file definition, a root element that you have to use in...