Book Image

Sphinx Search Beginner's Guide

By : Abbas Ali
Book Image

Sphinx Search Beginner's Guide

By: Abbas Ali

Overview of this book

Table of Contents (15 chapters)
Sphinx Search
Credits
About the Author
Acknowledgement
About the Reviewers
www.PacktPub.com
Preface

Time for action - creating the MySQL database and tables


  1. 1. Open phpMyAdmin and create a database sphinx_feeds. You can use an existing database as well.

  2. 2. Import the following SQL to create the database tables:

    CREATE TABLE `categories` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `name` varchar(100) NOT NULL,
    PRIMARY KEY (`id`),
    UNIQUE KEY `name` (`name`)
    ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    CREATE TABLE `feeds` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `name` varchar(255) NOT NULL,
    `url` varchar(255) NOT NULL,
    `last_modified` datetime DEFAULT NULL,
    PRIMARY KEY (`id`)
    ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    CREATE TABLE `items` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `title` varchar(255) NOT NULL,
    `guid` varchar(32) NOT NULL,
    `link` varchar(255) NOT NULL,
    `pub_date` datetime NOT NULL,
    PRIMARY KEY (`id`),
    UNIQUE KEY `guid` (`guid`)
    ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    
    

What just happened?

We created a new database which will be used by our PHP application. We then created the following tables...