473,406 Members | 2,273 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

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_Name /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_Directions /Varchar
Age_Restrictions /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_Restrictions LIKE '$Age_Restrictions%')
ORDER BY Date_Input, Band_or_Event_Name ASC";
May 5 '07 #1
0 1132

Sign in to post your reply or Sign up for a free account.

Similar topics

14
by: Lee Mundie | last post by:
Hi, wonder if anyone can help me with this - This was originally a simple search routine returning results back to itself! Trying to be smart I tried to combine a no. items per page so I could...
0
by: Chad Day | last post by:
my query: SELECT * FROM `links` WHERE MATCH ( KEYWORDS ) AGAINST ( 'paper' ); I have a table with 4 records in it of links to various newspapers, paper and newspaper are both in the keywords...
83
by: D. Dante Lorenso | last post by:
Trying to use the 'search' in the docs section of PostgreSQL.org is extremely SLOW. Considering this is a website for a database and databases are supposed to be good for indexing content, I'd...
1
by: SC | last post by:
I'm developing a site that may eventually have a very large database of users (hopefully, but who knows). It will be a community website where users can search each other (think Friendster,...
1
by: thepresidentis | last post by:
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...
10
by: jonathan184 | last post by:
Hi I tried getting this to work through dreamweaver but it did not. So i found a n example on the internet , i followed everything exactly the search script does not work. Could somebody help me...
7
by: daveeboi | last post by:
..I have been strugling to get this part of my site working correctly even though I can't see anything wrong with my code. I am trying to search a database and display paged results. But everytime...
1
by: russot00 | last post by:
I have 3 drop down menus that are used in a search to locate restaurants in a db. All of the drop down menus function, a search can be submitted with any combination of drop downs and the results are...
2
by: dmstn | last post by:
Hey! I've got a little problem. I have to make a web site for a university essay. I curently have to create a search engine. Users can enter a hotel name in a search bar and results have to appear in...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.