Database Articles
  Home arrow Database Articles arrow Page 5 - Creating a Search Application
Codewalker Forums 
  Tutorials  
Database Articles  
Miscellaneous  
Navigation Usability  
PEAR Articles  
Programming Basics  
Server Administration  
XML Tutorials  
  Reviews  
Database Book Reviews  
Linux Book Reviews  
Miscellaneous Reviews  
PHP Book Reviews  
PHP Software Reviews  
Server Admin Reviews  
SQL Tool Reviews  
  Code Gallery  
Content Management Code  
Contest Code  
Counters Code  
Database Code  
Date Time Code  
Discussion Board Code  
Email Code  
File Manipulation Code  
GUI Code  
Link Farm Code  
Miscellaneous Code  
Search Code  
Site Navigation Code  
User Management Code  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Download TestComplete 
Forums Sitemap 
Weekly Newsletter 
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
DATABASE ARTICLES

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

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

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Creating a Search Application -


    (Page 5 of 29 )

    A database server can contain many databases. Each database is a container for tables. The reason we would use multiple databases is to keep data for different applications, or users, separate from one another. As we mentioned earlier, we will assume that you are storing your tables in a database named test.

    The function we will use to select the database we want to work with is mysql_select_db(). Its syntax is very simple as demonstrated by this code.

    <?php
    mysql_select_db 
    ('test'$db)
          or die (
    "Could not select database");
    ?>

    The first parameter is the database we want to use and the second is the resource id from the mysql_connect() function. The second parameter is not mandatory if you are only dealing with one database, but it is good practice to use it. By always specifying the resource id, you can avoid complications when you start programming applications that utilize more than one database.

    Now that we have connected to our database server and selected the database we want to work with, it's time to put some data into our table and also examine how to retrieve that data.

    More Database Articles Articles
    More By Matt Wade


       · 
       · I've copy and paste the five files regarded in this tutorial, and created the db,...
       · Hello,


    'id' INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,

    I'm...
       · THANKS - MATTVery clear explained tutorial.Wonderful search, I am...
       · My phpadmin had no issues with the table creation, but can't get the harvest script...
       · It's an ok search tutorial, but too many errors.[QUOTE]Warning: array_walk()...
       · Where to post for help on this tutorial?CheersWest
       · great tutorial and very inspiring column in your conclusion.
     

    DATABASE ARTICLES ARTICLES

    - More on Query Optimization for Oracle Databa...
    - Query Optimization in Oracle
    - Clusters and Other Data Structures for Oracle
    - Using Indexes with an Oracle Database
    - The Basics of Data Structures in Oracle
    - Oracle Data Structures
    - Best Practices for PL/SQL Variables
    - What`s Code Without Variables?
    - Clauses, Sorting, and SQL Queries
    - The From Clause and SQL Queries
    - Query Primer
    - Full Text Searches and Strings
    - Searching with Strings
    - Pattern Matching with Strings
    - Working with Cases of Strings





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 2 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek