Single result from database

I have a search page that searches a database. I have used explode to split the search terms into single words using this code:

//split search terms seperated by space into array
	$keywordsArray = explode(' ',$search);
	foreach ($keywordsArray as $key => $value) {
		$whereArr[] = 'v.title LIKE '."'%$value%'";
		$whereArr[] = 'v.description LIKE '."'%$value%'";
	//define $clause
	$clause = implode(' OR ', $whereArr); 
	//end of split


With the search terms split I have a query that looks through the titles and descriptions of defined columns for results. This is working but is returning every instance. I only want 1 instance of a result.


If a store title has test, it returns that store, currently it’s displaying the store multiple times rather than 1 instance. Same with descriptions.

This is my query:

$data = mysql_query("SELECT DISTINCT s.store_name, s.image, p.title, p.description FROM storet s LEFT JOIN products p ON p.merchant_name = p.merchant_name WHERE " . $clause . " AND'1' ORDER BY s.storet_name ASC");

while($row = mysql_fetch_array($data)) {
	$store_name = $row['store_name'];
	$image = $row['image'];

Is there a way to see if $store_name exists more than once and then just a single instance of it rather than displaying every instance that a search term appears in the store?


No need sorted it by using GROUP BY in my query