Jump to content

*SOLVED* ignoring non-unique results on SELECT statements


bcamp1973

Recommended Posts

when i do the following SELECT statement it's possible for the recipe to be returned multiple times if an ingredient applies more than once...such as a search on "garlic" that may return on "garlic", "garlic cloves", "garlic salt" etc.  How can i limit the select so it only returns one instance of the recipe even on multiple ingredient matches?

[code]
SELECT
   recipes.name,
   recipes.description
FROM
   recipes, recipe_ingredients
WHERE
   recipe_ingredients.recipe_id=recipes.id
AND MATCH(ingredient) AGAINST ("'.strtolower($_GET['ingredient']).'" IN BOOLEAN MODE)
ORDER BY name ASC
[/code]

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.