We have DB type:
id name type 1 first type1 2 first type2 3 second type1
Request to DB
$qr = mysql_query("SELECT * FROM `base` GROUP by `name`") or die(mysql_error());
After grouping, you must display the data in the following way:
while($data = mysql_fetch_array($qr)){ echo'Имя: '.$data[name].''; echo'Тип:'.$data[type].''; }
in the type string, you must list all variants of the type string from mysql, where the name string is the same, but since I was grouped to give only one result, and how to display all?
group by
, but just inphp
process the array as you need (grouped by name, for example), and output. - Moonvvell