problem with returning all search results MYSQL PHP

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • thepresidentis
    New Member
    • Feb 2007
    • 12

    problem with returning all search results MYSQL PHP

    here is my problem,
    i have a website that compiles concert listings for users to search for shows in their local area, i ran into a problem with returning search results due to an improper format of my query, So i formatted the query properly Thanks to steve Klein :) , and all worked fine because there was only 1 show in my data base,
    I tryed to search for the show and it returned properly, and then i searched for the show with a different date and it did not return, (thats what i wanted)
    but now i populated the database with some more concert listings, and i searched for them using the proper date and location and now it will return no results for any of the other shows. (accept for the 1 show previously in my database).
    any suggestions on why it will return this one show but when i search for another show with the exact data as the listing in the DB it will not return
    here is how my database is set up.....

    here are the columns in my table
    id /PK, Auto Inc, Unsigned
    State /Varchar
    City /Varchar
    Metro_Area /Varchar
    Date_Input /Date
    Band_or_Event_N ame /Varchar
    Genre /Varchar
    Genre_1 /Varchar
    Genre_2 /Varchar
    Genre_3 /Varchar
    Genre_4 /Varchar
    Venue /Varchar
    Other_info /Varchar
    MP3_Link /Varchar
    Link_to_Directi ons /Varchar
    Age_Restriction s /Varchar

    HERE IS MY QUERY

    $query = "SELECT * FROM events WHERE
    (((State LIKE '$State') AND
    (City LIKE '$City%')) OR
    (Metro_Area LIKE '$Metro_Area%') ) AND
    (Date_Input LIKE'$orderdate ') AND
    (Band_Or_Event_ Name LIKE '$Band_or_Event _Name%') AND
    (Genre LIKE '$Genre' OR Genre_2 LIKE '$Genre' OR Genre_3 LIKE '$Genre' OR Genre_4 LIKE '$Genre') AND
    (Venue LIKE '$Venue%') AND
    (Age_Restrictio ns LIKE '$Age_Restricti ons%')
    ORDER BY Date_Input, Band_or_Event_N ame ASC";
Working...