Database Articles

  Home arrow Database Articles arrow Page 3 - Creating a Search Application
DATABASE ARTICLES

Creating a Search Application
By: Matt Wade
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 3 stars3 stars3 stars3 stars3 stars / 16
    2003-07-15

    Table of Contents:
  • Creating a Search Application
  • Database Usage
  • Creating a Search Application
  • Searching
  • Conclusion

  •  
     

    SEARCH CODEWALKERS

    TOOLS YOU CAN USE

    advertisement

    Creating a Search Application -


    (Page 3 of 29 )

    The first step in dealing with databases is to create the tables, or structure, you need on the database server. For this step, we will assume that you have access to a tool like phpMyAdmin where you can issue SQL statements to your database server. It is well beyond the scope of this tutorial to explain how tables are created and designed. Therefore, for our purposes, we will just provide you with SQL statements to create any tables that are necessary.

    For this introduction to databases, we will work with a table named introduction that can be created with the following SQL statement. We will assume that this table is created in a database named test.

    CREATE TABLE 'introduction' (
      'id' INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
      'last_name' VARCHAR( 50 ) NOT NULL ,
      'first_name' VARCHAR( 50 ) NOT NULL
    ) TYPE=MyISAM COMMENT='Example Table';

    This table has three columns named id, last_name, and first_name. The column named id is an auto increment column. This means that as data is inserted into this table, the id column will automatically be assigned a number that is unique because it will be assigned an id value that is one greater than that of the current highest-numbered id value in that table. This feature does not exist in all database servers, but it does in MySQL. The other two columns will each hold a string value that is up to 50 characters in length.

    MySQL provides several different types of tables. We will be using the MyISAM table type as specified by the TYPE declaration. As you can see, you can also specify a comment about a table when you create it. This simply allows for a description to be placed on the table for later reference.

    After this table is created, it will not contain any data, or rows. We will need to populate it with data, but first we need to establish a connection to the database server in PHP.

    More Database Articles Articles
    More By Matt Wade

    blog comments powered by Disqus

    DATABASE ARTICLES ARTICLES

    - Completing a Book Inventory Management System
    - Uploading Images for a Book Inventory Manage...
    - Finishing the Add Book Story for a Book Inve...
    - Integration Testing for a Book Inventory Man...
    - User Stories for a Book Inventory Management...
    - Unit Testing a Book Inventory Management Sys...
    - Testing a Book Inventory Management System
    - Implementing Models for a Book Inventory Man...
    - Book Inventory Application: Publishers and B...
    - Handling Publishers in a Book Inventory Mana...
    - Publisher Administration for Book Inventory ...
    - Book Inventory Management
    - Using the SQL Reference Manual
    - Using Oracle SQL Developer with SQL Statemen...
    - Fixing Errors with Oracle SQL Developer


    © 2003-2012 by Developer Shed. All rights reserved. DS Cluster 5 - Follow our Sitemap