Book Image

Learning Joomla! 1.5 Extension Development

Book Image

Learning Joomla! 1.5 Extension Development

Overview of this book

Table of Contents (17 chapters)
Learning Joomla! 1.5 Extension Development
Credits
About the Author
About the Reviewer
Preface

Including SQL queries


To add the tables that we need for managing the reviews, some SQL queries should be run. To do this, we will add the queries to some files that will be run when the component is installed and uninstalled. Create a new file named install.mysql.sql in the /administrator/components/com_restaurants folder, and enter the following queries into this file:

CREATE TABLE IF NOT EXISTS `#__reviews` (
`id` int(11) NOT NULL auto_increment,
`name` varchar(255) NOT NULL,
`address` varchar(255) NOT NULL,
`reservations` varchar(31) NOT NULL,
`quicktake` text NOT NULL,
`review` text NOT NULL,
`notes` text NOT NULL,
`smoking` tinyint(1) NOT NULL default 0,
`credit_cards` varchar(255) NOT NULL,
`cuisine` varchar(31) NOT NULL,
`avg_dinner_price` tinyint(3) NOT NULL default 0,
`review_date` datetime NOT NULL,
`published` tinyint(1) NOT NULL default 0,
PRIMARY KEY ('id')
);
CREATE TABLE IF NOT EXISTS `#__reviews_comments` (
`id` int(11) NOT NULL auto_increment,
`review_id` int(11) NOT NULL...