duplicate entries from mysql LIKE query with this sample dataset



I have this query

SELECT products.id, 
                        products.title AS product_title, 
                        products.code, 
                        products.created, 
                        products.modified,
                        products.active,
                        attributes.title AS attr_title,
                        attribute_entries.title AS attr_entry_title
                        FROM products 
                        INNER JOIN attributes ON attributes.model_id = products.id 
                        INNER JOIN attribute_entries ON attribute_entries.FK_attribute_id = attributes.id WHERE ( products.id LIKE '%" . $model['value'] . "%' OR products.code LIKE '%" . $model['value'] . "%' OR products.title LIKE '%" . $model['value'] . "%') limit 10


For some reason I get duplicates in my result set.  I have done this type of query before but I never got duplicates.  Although this is the first time I query the id as well and treat it as string.  Is this my problem?
I just added GROP BY products.id and it is fine now.  dumb, dumb.

IF this isn't proper or a better solution please feel free to post.

SELECT products.id, 
                    products.title AS product_title, 
                    products.code, 
                    products.created, 
                    products.modified,
                    products.active,
                    attributes.title AS attr_title,
                    attribute_entries.title AS attr_entry_title
                    FROM products 
                    INNER JOIN attributes ON attributes.model_id = products.id 
                    INNER JOIN attribute_entries ON attribute_entries.FK_attribute_id = attributes.id WHERE ( products.id LIKE '%" . $model['value'] . "%' OR products.code LIKE '%" . $model['value'] . "%' OR products.title LIKE '%" . $model['value'] . "%') GROUP BY products.id limit 10