SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2004
    Location
    USA
    Posts
    80
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Advanced Search engine

    Hi guys,

    i need help doing something in PHP. Let's say I have a database of sports players. Now, I want to do an advanced search for a player...

    Let's say I have a drop down box to select which type of sport (Basketball, Soccer, etc.). How do I use that form value to make a specific selection to search for only Basketball?

    i.e....if this form basketball is picked...then SELECT * from players WHERE blahblahblah.

  2. #2
    SitePoint Wizard silver trophy
    Join Date
    Mar 2006
    Posts
    6,132
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    if ($_POST['sport'] != '') {
       
    // SELECT * from players WHERE blahblahblah = $_POST['sport']



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
  •