473,804 Members | 3,373 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

problem with returning all search results MYSQL PHP

12 New Member
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";
May 5 '07 #1
0 1164

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

Similar topics

14
2147
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 limited items displayed... Okay problem! everything seems to be okay except it is returning no results, when I know it should the SQL string appears to be okay and if I remove the search criteria handlers then it kinda works but still not right!
0
1262
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 field. The keywords field has a fulltext index on it. Did I totally miss a step somewhere? The query doesn't error, I just get 0 results back. Thanks, Chad Day
83
5972
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 expect a much faster performance. I submitted my search over two minutes ago. I just finished this email to the list. The results have still not come back. I only searched for: SECURITY INVOKER
1
3027
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, Classmates, every dating site out there, etc.). Often there will be queries with multiple joins and sometimes may include a few fulltext searches. Each page of results will have a limited number of results displayed (obviously). As I understand it,...
1
1766
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 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...
10
2289
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 this please. Thanks for your help in advance. The form and script are on the same page. <?php require_once('../Connections/rs_ais.php'); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"...
7
2430
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 I perform a valid test expecting a few results to appear I am left with the No Matches message, so it's not a coding error as such. The code shown below is what I have for my search.php, please could someone put me out of my misery. <html>...
1
1629
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 sorted by restaurant name. The problem occurs when you do not select anything from a drop down ("All" is submitted for all drop downs) and submit the search, the following error occurs: "Can't connect because You have an error in your SQL syntax;...
2
2623
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 another screen. All of this has to be done with java servlets. I think there's something I don't see and it's wrong. My problem is that anything I enter in the search bar appears as a result in the results page, even if there's not such a name in...
0
9705
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9576
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10567
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10323
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10310
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9138
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7613
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6847
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5647
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.