SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Addict brain's Avatar
    Join Date
    Sep 2001
    Location
    Amsterdam
    Posts
    249
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How can I create a search function on a site with mySQL database and PHP

    I have made a site using PHP and mySQL. The database I'm using has 5 tables:
    -------------------------
    tblParty
    tblPartyLocation
    tblOrganisation
    tblCity
    tblState
    -------------------------
    Each table containing the proper information.

    Now I want a search function on my site where I can search for a party by Name, Date, Location or Organisation. What PHP code do I need to use ? (I'm also using Dreamweaver Ultradev with the Phakt extension for using PHP, but on the site of Macromedia there's only a tututial about searching the database using ASP, I've tried that but it didn't work on the PHP pages.)

  2. #2
    SitePoint Member
    Join Date
    Sep 2001
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    hey man...

    i am in the process of working on a function that takes a string and some variables about the database and makes an sql query for you, it is currently supporting phrase, any, all, and bool (AND, NOT, OR) search types. it also has the ability to only return a specified "chunk" of rows (so you can display results 1-10 then 11-20 et cetera)
    if you want the code once i'm done testing the balls out of it, i'll send you the code. (under the GPL)
    signature

  3. #3
    SitePoint Addict brain's Avatar
    Join Date
    Sep 2001
    Location
    Amsterdam
    Posts
    249
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    I want the code...

    I would like the untested code... if that's possible. My email address bjorno@zonnet.nl. But if you have a much simpler code that'll do too.

  4. #4
    Mlle. Ledoyen silver trophy seanf's Avatar
    Join Date
    Jan 2001
    Location
    UK
    Posts
    7,168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Can you tell us more about your tables please brain. You said you have the following fields, but which table are they in:

    Name, Date, Location or Organisation

    Sean
    Harry Potter

    -- You lived inside my world so softly
    -- Protected only by the kindness of your nature

  5. #5
    SitePoint Addict brain's Avatar
    Join Date
    Sep 2001
    Location
    Amsterdam
    Posts
    249
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The folowing fields:
    -Name
    -Date
    -Location (I meant city and club by that)
    -Organisation

    Are in the folowing tables:
    tblParty (Name, Date)
    tblPartyLocation (Club)
    tblOrganisation (Organisation)
    tblCity (City)
    tblState

    Is that what you wanted to know ?

    Greetz Brain

  6. #6
    SitePoint Zealot trigger8's Avatar
    Join Date
    Nov 2000
    Location
    Dallas, TX
    Posts
    133
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    I want the code too

    Hi brain,

    Have you tested the code? I would like to try it out if you don't mind. Thanks!
    Trigger8

    **************************
    I killed a 6-pack just to watch it die!


Bookmarks

Posting Permissions

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