Jump to content

Need help refining a Query


webguync

Recommended Posts

I am working on  Query application which returns results from a MySQL DB. The database consist of players from various sports teams, and list their name, city, sport, etc.

 

The issue is if you type in a search terms from one of the fields any result will return and I only want unique results. For instance if you type in 'New York Giants', you will get a return of all the New York teams, even though I have city and team name in two different columns.  The Query is matching 'New York and returning all results with that in the Query. Anyway here is my SQL code.

 

SELECT sport,first_name,last_name,MVP,city,Picture,team
FROM players 
WHERE MATCH(sport,first_name,last_name,MVP,city,team,Picture)
AGAINST('$query' IN BOOLEAN MODE)");

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.