Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2009
    Posts
    4

    Unanswered: mysql & PHP Database Site

    ok, I will try to keep this as simple as I can. Here is what I am trying to do:

    First off I have a working knowledge of html and CSS.
    What I am trying to do is create a website that will allow people who visit my site to search for certain data that I will have in a mysql database.

    I am somewhat familiar on how to create a database, I even bought the book "Build your own database driven website using PHP and mysql" by Kevin Yank.
    I guess my main question is once I create the database how do I have a search field on the website and have the information appear as a html webpage with the results it pulls from the database?

    Here is an example:
    Let's say i have a website about poems. I want to give my visitors the option to search the database by author or poem title or even keywords using a search form and display the results in a table format.

  2. #2
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    This post had nothing to do with Microsoft SQL, which is where you'd originally posted it.

    You really should investigate a CMS (Content Managment System) like XOOPS. Drupal, or Joomla since they probably already have something very close to what you want.

    Since PHP is the closest forum here at DBForums, that's where I've moved your thread for the time being. If you use any of the CMS packages I noted above, you'll be using PHP so this might actually be a great place for your post.

    -PatP
    In theory, theory and practice are identical. In practice, theory and practice are unrelated.

  3. #3
    Join Date
    Sep 2009
    Posts
    4

    Thanks you PAt

    Thanks Pat

  4. #4
    Join Date
    Jun 2007
    Location
    London
    Posts
    2,527
    Quote Originally Posted by mattzx11 View Post
    I am somewhat familiar on how to create a database, I even bought the book "Build your own database driven website using PHP and mysql" by Kevin Yank.
    I guess my main question is once I create the database how do I have a search field on the website and have the information appear as a html webpage with the results it pulls from the database?
    I'd follow the following stages:
    • First build your database
    • Add some test data to the database
    • Write some SQL to list the poem titles and their id
    • Write a PHP program to list the titles
    • Allow the user to click the poem titles and so pass the id to your program which then will show that poem in full.
    • Create a html form on your web page to enter a search string
    • Use this string to try and match against poets or failing that poems and list the poems on the web page so the user can either click one or improve his search
    • When you get more poems added then you won't be able to list them all so you might want to list just the 10 latest poems added or the 10 most popular or perhaps poems written by poets whose birthday was today
    • You might want to group poems into different types ie Romantic, Haiku, Limerick or Canzone etc and allow the user to restrict searches by this type.
    • Advertise it to the world so that every late teen can share their angst
    An example program might be
    Code:
        connect to your database
    
        show title of your site and a search field
    
        if an id has been passed
            show just that poem
        else if a search string has been passed
            list up to 10 poems that might match by author or title
            if none found then list up to 10 poems that might match in their text
        else
            list 10 latest poems

  5. #5
    Join Date
    Sep 2009
    Posts
    4

    Thanks Mike

    Mike,
    Thanks for you reply. I think I might have given a bad example. Let me explain it this way. Here is actually what I am trying to create.

    I am going to have a website for various types of business (etc, restaurants, flower shops, nail salon etc,etc,etc) I am going to have a database of these business and I want to let people search by the following: catagory/keyword, zip code and business name. Then after they enter their search criteria the page will display their results and each result will have a link to that businesses splash page that I will create.

    So if for an example someone comes to my site and they are wanting to find a flower shop in their area. I would want them to select flower shop and put in their zip code.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •