Hello,

I have set up a searchable database code for my website and I was wondering if it is possible to filter the database if I have two of the same names.

Example: my database consists of names and other information, but I have similar names but different information for each name. Would it be possible to output only 1 name and output multiple information for that name instead of outputting multiple names and information.

PS: I set up so when you search for a name, there will be similar resulting names using the LIKE and % symbol.

LIKE '%".mysql_real_escape_string($search_term)."%'

Any suggestions?

Thank you

Nevermind. sorry. I think GROUP BY works.

Thanks

Okay, I guess I still need help for what I'm trying to do.

Even if I group my results, I still have other columns with different information but the same name. I'm trying to do another while loop inside the while loop for fetching the array. How do I output the results of the information if there are same names.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.